Forum Discussion

Bryanh6288's avatar
Bryanh6288
Copper Contributor
Oct 02, 2023

Extract a specific number from a line of text in a cell

<span;>I need to extract a number from a line of text in cell C3 to a different cell H3. For example text in C3 is: ANGLE, 1-1/2" X 1-1/2" X 1/8" X 60",SP(GALVANIZED)
<span;>I need to extract only the number 60 to another cell H3

  • Bryanh6288 

    In H3:

    =LET(Parts, TEXTSPLIT(INDEX(TEXTSPLIT(C3, ","), 2), " "), Num, COUNTA(Parts), Last, INDEX(Parts, Num), --SUBSTITUTE(Last, """", ""))

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    Do you happen to have more examples of text with desired numbers to be returned? The goal with any extraction formula is to create something that will work for anything you might encounter.

    • Bryanh6288's avatar
      Bryanh6288
      Copper Contributor

      I have lots of similar text in cell c3 but they all have in common the number i need to extract from the last X in the line. So i can extract to cell H3 for a formula in J3 total. It will be regularly used with the pasted data under bill of materials.

Resources