Finding numbers in cell with text

Lancer7

Board Regular
Joined
Oct 16, 2022
Messages
54
Office Version
  1. 365
Platform
  1. Windows
Cell B2
Specs:
Sold for $58,500 CAD = $40,432 USD, 2009 Massey Ferguson 9795, w/4200 P/U Header., 1253 Sep Hours
Cell B3
Specs:
3200 sep. hours, always stored inside, auto steer ready, excellent tires, pro drive unit, has power cast tail board for straw chopping, has 28' unloading auger, a/c works, used for wheat harvest this year. Does not sell with GPS unit-i.e. screen & globe

I am trying to make column C return the "Seperator hours" from cells in column B. Column B has hundreds of cells with specs of machines and they all have the hours listed before the letters "sep" but sometimes the text "sep" has a capital S and sometimes it does not. The hours are also not always in the same place in the cell as shown above in the example of what two of the cells in the "B" column look like. I also need the result to be in number form so that I can use it in number formulas after the fact
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Is the number of sep hours always 4 digits? If so, try this:
Excel Formula:
=--RIGHT(TEXTBEFORE(B3,"sep",1,1,0),5)
 
Upvote 0
Another option for values longer or shorter than 4, and maybe there's a more elegant solution, but this seems to work:

Excel Formula:
=LET(t,TEXTBEFORE(LOWER(B2),"sep"),-LOOKUP(0,-RIGHT(t,ROW(INDEX(C:C,1):INDEX(C:C,LEN(t))))))
 
Upvote 0
Solution
Not always 4 Jen but thank you! I should have mentioned that in my question as besides that it would have been perfect, Dreid that works perfect with it being 3 sometimes so thank you!
 
Upvote 0

Forum statistics

Threads
1,223,914
Messages
6,175,351
Members
452,638
Latest member
Oluwabukunmi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top