banner



How To Separate Text In Excel Using Formula

Split text and numbers

Excel formula: Split text and numbers

Generic formula

                    =                    MIN                    (                    Find                    (                    {                    0                    ,                    1                    ,                    2                    ,                    3                    ,                    four                    ,                    five                    ,                    6                    ,                    7                    ,                    8                    ,                    9                    }                    ,A1&                    "0123456789"                    ))                  

Summary

To separate text and numbers, you tin use a formula based on the Detect role, the MIN function, and the LEN part with the LEFT or RIGHT function, depending on whether you lot want to extract the text or the number. In the example shown, the formula in C5 is:

                    
                        =                        MIN                        (                        Notice                        (                        {                        0                        ,                        1                        ,                        2                        ,                        iii                        ,                        4                        ,                        5                        ,                        6                        ,                        seven                        ,                        viii                        ,                        9                        }                        ,B5&                        "0123456789"                        ))                      

which returns 7, the position of the number 3 in the cord "apples30".

Explanation

Overview

The formula looks complex, but the mechanics are in fact quite simple.

As with virtually formulas that split up or extract text, the key is to locate the position of the thing you lot are looking for. In one case you have the position, you can use other functions to extract what you need.

In this case, nosotros are assuming that numbers and text are combined, and that the number appears later the text. From the original text, which appears in one cell, you want to split the text and numbers into separate cells, similar this:

Original Text Number
Apples30 Apples 30
peaches24 peaches 24
oranges12 oranges 12
peaches0 peaches 0

As stated above, the key in this case is to locate the starting position of the number, which you lot can do with a formula like this:

                    
                        =                        MIN                        (                        FIND                        (                        {                        0                        ,                        1                        ,                        two                        ,                        3                        ,                        4                        ,                        5                        ,                        vi                        ,                        7                        ,                        8                        ,                        9                        }                        ,A1&                        "0123456789"                        ))                      

Once you have the position, to extract just the text, use:

                  

And, to extract just the number, use:

                  

In the first formula above, we are using the FIND function to locate the starting position of the number. For the find_text, we are using the array abiding {0,1,2,3,four,v,6,seven,8,nine}, this causes the FIND function to perform a dissever search for each value in the array constant. Since the array constant contains x numbers, the result will exist an array with 10 values. For example, if original text is "apples30" the resulting assortment volition be:

                    
                        {                        8                        ,                        10                        ,                        11                        ,                        7                        ,                        thirteen                        ,                        14                        ,                        fifteen                        ,                        sixteen                        ,                        17                        ,                        18                        }                      

Each number in this array represents the position of an particular in the assortment constant inside the original text.

Next the MIN part returns the smallest value in the listing, which corresponds to the position in of the starting time number that appears in the original text. In essence, the FIND part gets all number positions, and MIN gives us the commencement number position: detect that seven is the smallest value in the array, which corresponds to the position of the number 3 in original text.

You might be wondering well-nigh the odd structure for within_text in the find function:

                  

This role of the formula concatenates every possible number 0-ix with the original text in B5. Unfortunately, Find doesn't return zippo when a value isn't establish, and then this is just a clever manner to avoid errors that could occur when a number isn't institute.

In this example, since we are bold that the number will always appear second in the original text, it works well because MIN forces merely the smallest, or beginning occurrence, of a number to be returned. As long as a number does appear in the original text, that position will exist returned.

If original text doesn't contain whatsoever numbers, a "bogus" position equal to the length of the original text + one will be returned. With this bogus position, the LEFT formula above will notwithstanding return the text and RIGHT formula will return an empty string ("").

Excel Formula Grooming

Formulas are the primal to getting things done in Excel. In this accelerated training, yous'll learn how to apply formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and Alphabetize & Match, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll besides learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.

Download 100+ Important Excel Functions

Become over 100 Excel Functions you should know in one handy PDF.

Excel video preparation

Quick, make clean, and to the point.

Learn more

Source: https://exceljet.net/formula/split-text-and-numbers

Posted by: plainnotnothe1980.blogspot.com

0 Response to "How To Separate Text In Excel Using Formula"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel