How to extract number from string in Excel

The tutorial shows how to extract number from various text strings in Excel by using formulas and the Extract tool.

When it comes to extracting part of a text string of a given length, Excel provides three Substring functions (Left, Right and Mid) to quickly handle the task. When it comes to extracting numbers from an alphanumeric string, Microsoft Excel provides… nothing.

To get a number from a string in Excel, it takes a little ingenuity, a bit of patience, and a bunch of different functions nested into each other. Or, you can run the Extract tool and have the job done with a mouse click. Below you will find full details on both methods.

How to extract number from the end of text string

When you have a column of alphanumeric strings where number comes after text, you can use the following formula to get it.

RIGHT(cell, LEN(cell) - MAX(IF(ISNUMBER(MID(cell, ROW(INDIRECT("1:"&LEN(cell))), 1) *1)=FALSE, ROW(INDIRECT("1:"&LEN(cell))), 0)))

We will dwell on the formula's logic a bit later. For now, simply replace cell with a reference to the cell containing the original string (A2 in our case), and enter the formula in any empty cell in the same row, say in B2:

=RIGHT(A2, LEN(A2) - MAX(IF(ISNUMBER(MID(A2, ROW(INDIRECT("1:"&LEN(A2))), 1) *1)=FALSE, ROW(INDIRECT("1:"&LEN(A2))), 0)))

This formula gets number only from the end. If a string also has numbers in the beginning or middle, they are ignored:
alt=

The extraction is performed with the RIGHT function that belongs to the category of Text functions. The output of this function is always text. In our case, the result is a numeric substring, which in terms of Excel is also text, not number.

If you need the result to be a number (that you can use in further calculations), then wrap the formula into the VALUE function or perform an arithmetic operation that does not change the result, say, multiply by 1 or add 0. To catch errors in the strings that do not contain a single number, use the IFERROR function. For example:

=IFERROR(VALUE(RIGHT(A2, LEN(A2) - MAX(IF(ISNUMBER(MID(A2, ROW(INDIRECT("1:"&LEN(A2))), 1)*1)=FALSE, ROW(INDIRECT("1:"&LEN(A2))), 0)))), "")

or

=IFERROR(RIGHT(A2, LEN(A2) - MAX(IF(ISNUMBER(MID(A2, ROW(INDIRECT("1:"&LEN(A2))), 1) *1)=FALSE, ROW(INDIRECT("1:"&LEN(A2))), 0))) +0, "")
An improved formula to extract number from the end of a string

Note. In Dynamic Array Excel (Office 365 and 2021), you enter the formula in the usual way with the Enter key. In Excel 2019 and earlier, it only works as an array formula, so remember to press Ctrl + Shift + Enter to complete it.

How this formula works:

To extract number from an alphanumeric string, the first thing you need to know is where to start the extraction. The position of the last non-numeric character in a string is determined with the help of this tricky formula:

MAX(IF(ISNUMBER(MID(A2, ROW(INDIRECT("1:"&LEN(A2))), 1)*1)=FALSE, ROW(INDIRECT("1:"&LEN(A2))), 0))

To understand the logic, let's investigate it from the inside:

The ROW(INDIRECT("1:"&LEN(A2))) combination creates a sequence of numbers corresponding to the total of characters in the source string (A2), and we serve these sequential numbers to MID as the starting numbers:

MID(A2, {1;2;3;4;5;6;7;8}, 1)

The MID function pulls each individual character from A2 and returns them as an array:

{"0";"5";"-";"E";"C";"-";"0";"1"}

As MID is a text function, its output is always text (as you can notice, all the characters are enclosed in quotation marks). To turn numeric ones into numbers, we multiply the array by 1 (double negation --MID() will have the same effect). The result of this operation is an array of numbers and #VALUE! errors representing non-numeric characters:

ISNUMBER({0;5;#VALUE!;#VALUE!;#VALUE!;#VALUE!;0;1})

The ISNUMBER function evaluates each element of the array and gives its verdict in the form of Boolean values - TRUE for numbers, FALSE for anything else:

{TRUE;TRUE;FALSE;FALSE;FALSE;FALSE;TRUE;TRUE}

This array goes to the logical test of the IF function, where each element of the array is compared against FALSE:

IF({TRUE;TRUE;FALSE;FALSE;FALSE;FALSE;TRUE;TRUE}=FALSE, ROW(INDIRECT("1:"&LEN(A2))), 0)

For each FALSE (non-numeric value), another ROW(INDIRECT()) function returns its relative position in the string. For each TRUE (numeric value), a zero is returned. The resulting array looks as follows:

{0;0;3;4;5;6;0;0}

The rest is easy. The MAX function finds the highest number in the above array, which is the position of the last non-numeric value in the string (6 in our case). Simply, subtract that position from the total length of the string returned by LEN, and pass the result to RIGHT to let it know how many characters to extract from the right side of the string:

RIGHT(A2, LEN(A2) - 6)

Done!

How to extract number from the beginning of text string

If you are working with records where text appears after number, you can extract number from the start of a string by using this generic formula:

LEFT(cell, MATCH(FALSE, ISNUMBER(MID(cell, ROW(INDIRECT("1:"&LEN(cell)+1)), 1) *1), 0) -1)

With the original string in A2, use the following formula to get number:

=LEFT(A2, MATCH(FALSE, ISNUMBER(MID(A2, ROW(INDIRECT("1:"&LEN(A2)+1)), 1) *1), 0) -1)

No matter how many digits are in the middle or end, only the starting number is extracted:
Formula to extract number from the beginning of text string

Note. In Excel 365 and Excel 2021, due to support for dynamic arrays, a regular formula works fine. In Excel 2019 and earlier, you should press Ctrl + Shift + Enter to explicitly make it an array formula.

How this formula works:

Here, we again use the combination of ROW, INDIRECT and LEN functions to create a sequence of numbers equal to the total of characters in the source string plus 1 (the role of that additional character will become clear a bit later).

ROW(INDIRECT("1:"&LEN(A2)+1))

MID and ISNUMBER do the same job as in the previous example - MID pulls individual characters and ISNUMBER converts them to the logical values. The resulting array of TRUE's and FALSE's goes to the MATCH function as a lookup array:

MATCH(FALSE, {TRUE;TRUE;FALSE;FALSE;FALSE;FALSE;TRUE;TRUE;FALSE}, 0)

MATCH computes a relative position of the first FALSE, giving us the position of the first non-numeric character in the string (3 in A2). To extract the preceding numbers, we subtract 1 from position the first text character and serve the difference to the num_chars argument of the LEFT function:

LEFT(A2, 3-1)

Now, back to an "extra" character in the sequence generated by ROW(INDIRECT()+1)). As you already know, this sequence provides the starting points for the MID function. Without +1, MID would extract exactly as many characters as there are in the original string. If the string contains only numbers, ISNUMBER will return only TRUE's while MATCH needs at least one FALSE. To ensure that, we add one more character to the total length of the string, which the MID function would convert to an empty string. For example, in B7, MID returns this array:

{"1";"2";"3";"4";""}

Note. As is the case with the RIGHT function, LEFT also returns a numeric substring, which is technically text, not number. To get the result as a number rather than a numeric string, nest the formula in the VALUE function or multiply the result by 1 as shown in the first example.

How to get number from any position in a string

If your task implies extracting number from anywhere in a string, you can make use of the following mind-boggling formula published on MrExcel forum:

=SUMPRODUCT(MID(0&A2, LARGE(INDEX(ISNUMBER(--MID(A2, ROW(INDIRECT("1:"&LEN(A2))), 1)) * ROW(INDIRECT("1:"&LEN(A2))), 0), ROW(INDIRECT("1:"&LEN(A2))))+1, 1) * 10^ROW(INDIRECT("1:"&LEN(A2)))/10)

Where A2 is the original text string.

Breaking down this formula would require a separate article, so you can simply copy it to your worksheet to make sure it really works :)
Formula to get number from any position in a string

Upon examining the results, however, you may notice one insignificant drawback - if the source string does not contain a number, the formula returns zero, as in row 6 in the screenshot above. To fix this, you can wrap the formula in the IF statement, the logical test of which checks if the source string contains any number. If it does, the formula extracts the number, otherwise returns an empty string:

=IF(SUM(LEN(A2)-LEN(SUBSTITUTE(A2, {"0","1","2","3","4","5","6","7","8","9"}, "")))>0, SUMPRODUCT(MID(0&A2, LARGE(INDEX(ISNUMBER(--MID(A2,ROW(INDIRECT("$1:$"&LEN(A2))),1))* ROW(INDIRECT("$1:$"&LEN(A2))),0), ROW(INDIRECT("$1:$"&LEN(A2))))+1,1) * 10^ROW(INDIRECT("$1:$"&LEN(A2)))/10),"")

As shown in the screenshot below, the improved formula works beautifully (kudos to Alex, our Excel guru, for this improvement):
An improved formula to extract number from anywhere in a string

Unlike in all previous examples, the result of this formula is number. To make sure of this, just notice the right-aligned values in column B and truncated leading zeros.

Tip. In Excel 365 - Excel 2019, there is a much simpler solution with the help of the TEXTJOIN function. Please see How to remove text and keep numbers.

Extract number from text string with Ultimate Suite

As you have just seen, there is no trivial Excel formula to pull number from a text string. If you have difficulties with understanding the formulas or tweaking them for your data sets, you may like this simple way to get number from string in Excel.

With our Ultimate Suite added to your Excel ribbon, this is how you can quickly retrieve number from any alphanumeric string:

  1. Go to the Ablebits Data tab > Text group, and click Extract:
    Extract tool for Excel
  2. Select all cells with the source strings.
  3. On the Extract tool's pane, select the Extract numbers radio button.
  4. Depending on whether you want the results to be formulas or values, select the Insert as formula box or leave it unselected (default).

    My advice is to select this box if you want the extracted numbers to update automatically as soon as any changes are made to the source strings. If you want the results to be independent on the original strings (e.g. in case you plan to remove the source data at a later point), then do not select this box.

  5. Click the Insert Results button. Done!

Extract numbers and insert the results as formulas or values.

Like in the previous example, the results of the extraction are numbers, meaning you are free to count, sum, average, or perform any other calculations with them.

In this example, we've chosen to insert the results as values, and the add-in did exactly what was asked for:
Numbers are extracted from strings as values.

If the Insert as formula checkbox was selected, you'd observe a formula in the formula bar. Curious to know which one? Just download Ultimate Suite's trial and see for yourself :)

Available downloads

Excel Extract Number - sample workbook (.xlsx file)
Ultimate Suite - trial version (.exe file)

562 comments

  1. Hi there. I appreciate the detailed approach to this challenge. I have the following text:

    "[SW] 183 Patterson -- WAN1 DOWN -- PL"

    I'm using the formula above "How to get number from any position in a string"

    Instead of returning 183, it returns 1831 - adding an extra 1 at the end?

    Another text:

    [SW] 016 Bremerton -- Router DOWN -- PWR" returns 16 instead of 016?

    All thoughts are very much appreciated.

    • Hello!
      Your first example has 4 digits. All of them are returned by the formula. In the second example, the result is returned as a number, not as text. Excel removes leading zeros from numbers.
      To extract numbers as text, try this formula:

      =CONCAT(IF(ISNUMBER(--MID(A2,ROW($1:$100),1)),MID(A2,ROW($1:$100),1),""))

      You can also extract numbers from text using regular expressions (Regex). I recommend this tutorial with examples: Regex to extract number from string.

  2. Hi,

    Thanks for sharing this very helpful code. I have a problem with number that has digit like 1.5 or 3.70 it turn to 15 and 370. Could you please guide me how to fix that :)

    Thanks again!

    • Hello!
      To extract a number with a decimal separator from text, use the formula:

      =CONCAT(IFERROR(MID(A2,(ISNUMBER(--MID(A2,ROW(INDIRECT("$1:$"&LEN(A2))),1))+ (MID(A2,ROW(INDIRECT("$1:$"&LEN(A2))),1)="."))* ROW(INDIRECT("$1:$"&LEN(A2))),1),""))

      I hope I answered your question.

  3. This formula looks so close to what I need. I'm wondering if someone wouldn't mind showing me how to tweak it to suit my requirement?

    We receive many payments each day with various narratives, I would like to automatically identify references which are 7 digit number beginning with "13" or "14". Examples below and to the right is the currently formula result.

    I am using this formula, essentially copied from above comments and info - I think I need to have the result only report back when the sequence beginning with "13" or "14" is 7 digits in length.

    Any thoughts?

    =IF(SUM(LEN(A22)-LEN(SUBSTITUTE(A22, {"13","14"}, "")))>0, SUMPRODUCT(MID(0&A22, LARGE(INDEX(ISNUMBER(--MID(A22,ROW(INDIRECT("$1:$"&LEN(A22))),1))* ROW(INDIRECT("$1:$"&LEN(A22))),0), ROW(INDIRECT("$1:$"&LEN(A22))))+1,1) * 10^ROW(INDIRECT("$1:$"&LEN(A22)))/10),"")

    PAYMENT FROM MR SIMON ZHAO LPSPR 8486 No result-correct
    TRANSFER 1322500 midas prch FROM SOON LEGAL 1322500-Correct
    TRANSFER Ref 1401272 Susann FROM J BOGAN 1401272-Correct
    PAYMENT FROM MS NILU JONCHHE Lot 136/Carseldine + Lot136/Carseldine 136136 - Incorrect
    0491400550 HORNSBY 491400550-Incorrect
    TRANSFER 1398031 FROM SETTLEMENT FUNDS 1398031-Correct

    Thank you

    • Hi!
      To extract 7 digit number beginning with “13” or “14” from text, you can use the formula

      =(MID(A2,SEARCH(" 13",A2)+1,7)* ISNUMBER(--MID(A2,SEARCH(" 13",A2)+1,7)))* ((--MID(A2,SEARCH(" 13",A2)+1,7)* ISNUMBER(--MID(A2,SEARCH(" 13",A2)+1,7))) > = 1000000)*(MID(A2,SEARCH(" 13",A2)+8,1)=" ")

      For the number "14", replace "13" with "14" in the formula.
      You can also use regular expressions to extract numbers from text.
      At the link above you will find detailed explanations and examples of how to extract text and numbers from a string. Here is an example formula that will solve your problem:

      =RegExpExtract(A1&" "; "\s[1][34]\d{5}\s")

      I hope it’ll be helpful. If something is still unclear, please feel free to ask.

  4. Hi, i need to extract a group of text from a cell, and sum them together. before i begin, i would like to clrify that, I am not an Excel pro user like accountant. I'm using it as a data link between AUTOCAD and EXCEL. so, please bear with me.

    A B c
    1 YES 1800/ 900/ 1200 X 500 3900
    2 NO 600/ 100/ 300/ 20 X 15 0

    YES and NO is in column A (row 1 and 2 respectively). while the number is in column B. and the sum will appear in column C next to each row. i'm looking for a formula to extract 1800, 900, and 1200 to sum it up into 3900 (1800+900+1200), and it only extract and sum it when the column A says "YES", and will not do the sum when A says "NO".

    • sorry, the sample text arrangement went wrong.

      YES 1800/ 900/ 1200 X 500 = 3900
      NO 600/ 100/ 300/ 20 X 15 = 0

    • sorry, the sample text arrangement went wrong.

      ignore the A,B,C above the sample and 1,2 on the left

      • Hi!
        You can extract numbers from text using substring functions with these formulas:

        =--LEFT(B1,SEARCH("/",B1)-1)
        =--MID(B1,SEARCH("/",B1)+1,SEARCH("/",B1,SEARCH("/",B1)+1)-1-SEARCH("/",B1))
        =--MID(B1,SEARCH("/",B1,SEARCH("/",B1)+1)+1,SEARCH("X",B1)-1-SEARCH("/",B1,SEARCH("/",B1)+1))

        Write the condition using the IF function:

        =IF(A1="YES",=--LEFT(B1,SEARCH("/",B1)-1),"")

        General formula for three numbers with condition:

        =IF(A1="YES",LEFT(B1,SEARCH("/",B1)-1)+ MID(B1,SEARCH("/",B1)+1, SEARCH("/",B1,SEARCH("/",B1)+1)-1-SEARCH("/",B1))+ MID(B1,SEARCH("/",B1,SEARCH("/",B1)+1)+1, SEARCH("X",B1)-1- SEARCH("/",B1,SEARCH("/",B1)+1)),"")

        • i see. Thanks for your help. i will need some times to explore what you shared with me. looking at the formula you gave, is killing my brain. lol. will get back to you how it goes.

          Thanks again for sharing

  5. Hey i have some problem.

    My job is to extract number from a cell. A cell has 4 digits of randomly generated number (ABCD). So i want to automatically extract number A into one cell, B into one cell and the rest. and sometimes i need to extract 2 number from the same cell. is there a clean way to do it?

  6. This was so helpful. I appreciate the effort of the team. Cheers!!!

  7. This was very helpful, thanks!

  8. Hi I hope you could help me!
    I have some prices i need to extract...

    ?XIAOMI?
    ?Redmi 9A 32GB/2R 399.900 A,G??
    ?Redmi 10 64GB 744.900 B??
    ?Redmi 10 128GB 839.900 G??
    ?Poco X3 128GB/8R 949.900 G,A ??
    ?Poco X3 Pro 128GB/6R 909.900 N??

    My question is... Is there a clean and simple way to only obtain the prices from this cellphones For example telling a formula to look for more than 4 consecutive numbers and extract them.

    Look at this...

    Redmi 9A 32GB/2R 399.900 A,G??

    When I use a formula to look for only numbers it extracts 9322399900
    I need something capable of skiping small number secuences and search for numbers bigger than (9A) (32GB) (2R) in this case 399000
    I know that I can search for common characters like ($) $399000 to use text to columns.
    But I have a wide range of providers that dont use any particular sign for me to use.

      • Thanks a lot I have never heard of that so I will study about regex and tell you how it goes for me.

        • Thanks a lot. Both of your formulas worked great. Its amazing. I post some examples to Svetlana
          Because some of my prices are in Millions and i was not able to interpret the formula to make it take into account bigger numbers. My knowledge of excel and english is very limited but I´m thankfull of your help. I´ve been doing this process the large way for about 2 years.
          I could clean all of my data to have numbers without any signs. Example:

          iPhone 13 128GB 5000000
          iPhone 13 Pro 246GB 4500000
          iPhone 12 Pro Max 512GB 3650000

          Thanks in advance to all of you for your great work!

          • Hi Simon,

            In case your prices have various delimiters like in the sample below, then cleaning the data before using the Regex formula is indeed the most effective way. As you said, first you remove all the characters between the prices (. , ’ ). And then, extract a number containing 4 or more digits using this simple regex:

            \d{4,}

    • Hello Simon,

      The only solution I can think of is using regular expressions. For this, you will need to add a custom RegExpExtract function to your workbook - the code and the detailed instructions are on the above-linked page.

      As for the regex pattern, I don't think searching for 4 consecutive numbers will work in your case, because the prices in your sample strings have a thousands separator (period). So, you can use the below regex to match a substring consisting of 1-3 digits, followed by a period (.), followed by 3 digits.

      Pattern: \b\d{1,3}\.\d{3}\b

      The above pattern will work for numbers ranging from 1.000 to 999.999. If your real dataset has a wider range of numbers, you'll have to adjust the pattern.

      • Thanks a lot I have never heard of that so I will study about regex and tell you how it goes for me.

        • It worked perfectly. Could you please help me adjust the pattern for millions. I tried to interpret your formula but i couldn´t understand which is the key to increment to millions
          I got some examples

          Store A Example
          Poco X3 Pro 8/256 GB $1’050.000 N-A ??
          Poco X3 GT 8/128 GB $1’230.000 ??
          Poco X3 GT 8/256gb $1.340.000 ??Blanco

          Store B Example
          IPHONE 12 MINI 64GB
          BLANCO
          $2.880.000

          IPHONE 12 MINI 128GB
          ROJO
          $3.100.000

          IPHONE 12 64GB
          BLANCO
          $3.300.000

          Store C Example
          11 pro max 256gb $4.200.000 negro????
          12 64gb $3.350.000 blanco verde negro????
          12 128gb $3.580.000 negro verde????
          12 pro max 256gb $5.100.000 azul????

          Store D Example
          POCO X3 GT 8/128 AZUL Y BLANCO
          $1’399.000??
          MI 10T LITE 6/128GB AZUL
          $ 1.235.000??
          MI 11 LITE 5G 6/128GB NEGRO
          $1’265.000??

          Store E Example
          Note 10 pro 128gb 6ram $1.329.000?? Azul
          Note 10 5G 128gb 4ram $949.900?? Gris
          Poco x3 pro de 128gb 6ram $ 924.900?? negro azul y bronce
          Poco x3 pro de 256GB 8ram $1.059.900?? Negro y azul
          Poco x3 GT 128gb 8ram $1.249.900?? azul negro y blanco

          There are like 15 stores sending prices over WhatsApp I would love to understand how to adjust the pattern in the most efficient way. I don´t have any problem cleaning the data before using the Regex Formula. I mean replacing... ( . , ’ ) all the characters between my prices.

  9. Hello Mr.Alexander Could you help me please I have example as below

    LG-101+CC100+S+22 11 21+625+3
    LG-101+CC100+S+22 11 21+625+300
    LG-101+CC109+M+22 11 21+609+220
    LG-76-2+92C+S+22 11 21+618+1140
    and I want to get only value after + at the end of the cell like below
    3
    300
    220
    1140

  10. It's works. You save my day.

  11. How to match the last five numbers of the 10 figure number or string

  12. I'm trying to extract number and the text attached to it, lets say I have a list of items with different sizes as 200ml & 300ml, I want to extract 200ml 300ml from the cell, and also remove it from the source cell, is there any way with or without your tool to do this?
    Thank you very much!

    • Hi!
      I cannot guess what is written in your data. Therefore, I can not offer a solution. Use the SEARCH function to find values.
      Perhaps something like this:

      =IF(ISNUMBER(SEARCH("200ml",A1)),"200ml","")

      You can only remove some of the text from a cell using a VBA macro.

  13. What went wrong here?

    A2: 10-Hour Orchid Class
    B2: =LEFT(A2, MATCH(FALSE, ISNUMBER(MID(A2, ROW(INDIRECT( "1:"&LEN(A2)+1)), 1) *1), 0) -1)

    Evaluation:
    =LEFT(A2, MATCH(FALSE, ISNUMBER(MID(A2, ROW(INDIRECT( "1:"&LEN(A2)+1)), 1) *1), 0) -1)
    =LEFT(A2, MATCH(FALSE, ISNUMBER(MID(A2, ROW(INDIRECT( "1:"&20+1)), 1) *1), 0) -1)
    =LEFT(A2, MATCH(FALSE, ISNUMBER(MID(A2, ROW(INDIRECT( "1:"&21)), 1) *1), 0) -1)
    =LEFT(A2, MATCH(FALSE, ISNUMBER(MID(A2, ROW(INDIRECT( "1:21")), 1) *1), 0) -1)
    =LEFT(A2, MATCH(FALSE, ISNUMBER(MID(A2, ROW(INDIRECT($1:$21)), 1) *1), 0) -1)
    =LEFT(A2, MATCH(FALSE, ISNUMBER(MID(A2, 1, 1) *1), 0) -1)
    =LEFT(A2, MATCH(FALSE, ISNUMBER("1" *1), 0) -1)
    =LEFT(A2, MATCH(FALSE, ISNUMBER(1), 0) -1)
    =LEFT(A2, MATCH(FALSE, TRUE, 0) -1)
    =LEFT(A2,#N/A -1)
    =LEFT(A2,#N/A)
    =#N/A

      • ROW(INDIRECT( "1:"&LEN(A2)+1)) seems to not be evaluating to a sequence, just the number 1 (1.00 to be precise). But I don't know why. On another machine, this formula worked.

    • u can use below one

      =LEFT(A2,MATCH(FALSE,ISNUMBER(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1)+0),0)-1)

      • u can use below one with ctrl+shift+Enter

        =LEFT(A2,MATCH(FALSE,ISNUMBER(MID(A2,ROW(INDIRECT("1:"&LEN(A2))),1)*1),0)-1)+0

  14. I would like to make a formula that can Extract the individual numbers from the example below. The numbers will change on either side of the x. My goal is to extract the single digits and place them in their own sell. The example below will be located in one cell group together again the digits will change depending on information.

    Example one .75 x 2 x 31
    Example two. 4 x 89 x 107

    .75 x 2 x 31 >>>> 0.75 2 31
    4 x 89 x 107 >>>> 4 89 107

  15. Hi All,

    I have a sentence in one cell and want to extract all the values in multiple columns e.g.

    Data in cellA1
    Total sales increased $58.9 billion or 4.5% from October 31, 2020 due increase in demand medical products by $15.2 billion or 2%

    I want all the Monetary values and % in different cells
    B1 = 58.9
    C1 = 4.5
    D1 = 15.2
    E1 = 2

      • Hey Alex, I have tried those..but thats not helpful..as those are also extracting 31 and 2020 which is not relevant..Could you please help me on the same

        • Hi!
          If you have a pattern in your data, you can write a formula that will remove the date. Only all numbers can be extracted from the text.

  16. I Textjoin row of cells. Only one contains date and time. Other cells, if NOT blank, contains text including numbers NOT dates.

    Textjoin works but date and time is now in serial format.

    How to convert that serial format within the Textjoin Output back to date and time?

    • I solved by extract 9 consecutive digits (including decimals) but hope better solution such as avoiding indirect...
      =
      MAX(
      IFERROR(
      IF(
      LEN(
      VALUE(
      1*
      MID(
      $A$2,
      ROW(INDIRECT("1:"&(LEN($A$2)-9))),
      9)

      )
      )=9,
      VALUE(
      1*
      MID(
      $A$2,
      ROW(INDIRECT("1:"&(LEN($A$2)-9))),
      9)

      ),
      ""),""))

  17. Hi there,

    Is there one formula that can turn the below into "h:mm:ss"? The data source can be in below formats
    3h 31m
    8h
    51m 3s

  18. Hi!

    I am looking for a formula to return the first two digits of an account number

    ie account number1 =1212341234567000
    account number2 =0812341234567000

    I want to be able to return just 12 for account 1 and 08 for account 2. (I then want to assign a name for each of these first two digits).

    Please help :)

    • =LEFT(CELLNUMBER1;2)

  19. Hello, thanks for your help! Can you please help with the following:
    Each row corresponds to one cell:

    53QBx13 bunches Limonium Piña Colada 70cm (10st) $2.60
    13QBx13 bunches Limonium Piña Colada 80cm (10st) $2.80
    8EBx10 bunches Limonium Oshi Pink BQT 60cm (20st) $3.50

    I need to extract in columns the following:
    Column 1
    53
    13
    8
    Column 2
    QB
    QB
    EB
    Column 3
    13
    13
    10
    Column 4
    Limonium Piña Colada
    Limonium Piña Colada
    Limonium Piña Colada
    Column 5
    70
    80
    60
    Column 6
    $2.60
    $2.80
    $3.50

    Is this possible?

    Thanks!

  20. Hi Alexander! I just wanted to thank you so very much for your time and effort in assisting me.

    In case you were curious, I was able to extract and add the numbers that I wanted by using this VBA code along with "SUMNUMS":

    Function SumNums(pWorkRng As Range, Optional xDelim As String = " ") As Double
    Dim arr As Variant
    Dim xIndex As Long
    arr = Split(pWorkRng, xDelim)
    For xIndex = LBound(arr) To UBound(arr) Step 1
    SumNums = SumNums + VBA.Val(arr(xIndex))
    Next
    End Function

    Thanks again, you are amazing!

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)