Finding numbers in cell with text

Lancer7

Board Regular
Joined
Oct 16, 2022
Messages
57
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

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
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
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
Hey! Going back to this old post here, Your solution dreid worked great but I am having the odd cell give me issues where the number Im trying to bring back Is coming back as "0". It seems to always be ones that have two or more zeros on the end. A couple cell examples that I have returning 0 Sep hours are :

Specs:
SN: 1H0S680SPC0747721, 650/85R38 w/Duals, 2WD, 750/65R26 Chopper CM P Fold Bin Ext, Pro Drive, 26' Unload, Prem. Cab, Auto Trac Ready, GreenStar 3 7" Display, Yield Mon, 3400 Sep. Hours

Specs:
3000 Sep. Hours, Front Duals, Precision Ag Monitoring Upgrade System, Mud Hog 4WD System, Buddy Seat, Per Customers Sieve Replaced 2021

Specs:
Integrated Auto Steer, 2313 Engine Hours, 1600 Separator Hours, 3 Speed Manual Transmission, 4WD 2 Speed, Heavy Duty Variable Speed FH, Hi-Capacity FH Lift Cylinders, Premium Header Control, Greenstar Harvest Monitoring System (no display or receiver included), Integrated Auto Trac Steering Valve, Touchset Concave Adjustment, Large Round Bar Concave Ext Wear, Gen Purpose Chaffer, 6.9M Unloading Auger Hi-Capacity, Fine Cut Chopper w/ Tailboard Spreader, Heavy Duty Final Drives, Rear Tires 28L-26 Firestones, Brand New Fron Duals 520/85R42 Firestones, 110V Coolant Heater, Clean Grain Auger and Fan Bottom Protection Package, LED Upper Cab Lights, 6090 9L Engine, Inspected and Maintained Annually by Sydenstrickers in Mexico, Can Provide 5 Years Past Service Records, Front Shoe Auger Plate Has Been Updates in 70S Services, Has Mainly Been a Secondary Machine for Beans Only, Will Include a Headsight Kit to Run a Deere Draper
 
Upvote 0
Try:
Book2
BC
1
2SN: 1H0S680SPC0747721, 650/85R38 w/Duals, 2WD, 750/65R26 Chopper CM P Fold Bin Ext, Pro Drive, 26' Unload, Prem. Cab, Auto Trac Ready, GreenStar 3 7" Display, Yield Mon, 3400 Sep. Hours3400
33000 Sep. Hours, Front Duals, Precision Ag Monitoring Upgrade System, Mud Hog 4WD System, Buddy Seat, Per Customers Sieve Replaced 20213000
4Integrated Auto Steer, 2313 Engine Hours, 1600 Separator Hours, 3 Speed Manual Transmission, 4WD 2 Speed, Heavy Duty Variable Speed FH, Hi-Capacity FH Lift Cylinders, Premium Header Control, Greenstar Harvest Monitoring System (no display or receiver included), Integrated Auto Trac Steering Valve, Touchset Concave Adjustment, Large Round Bar Concave Ext Wear, Gen Purpose Chaffer, 6.9M Unloading Auger Hi-Capacity, Fine Cut Chopper w/ Tailboard Spreader, Heavy Duty Final Drives, Rear Tires 28L-26 Firestones, Brand New Fron Duals 520/85R42 Firestones, 110V Coolant Heater, Clean Grain Auger and Fan Bottom Protection Package, LED Upper Cab Lights, 6090 9L Engine, Inspected and Maintained Annually by Sydenstrickers in Mexico, Can Provide 5 Years Past Service Records, Front Shoe Auger Plate Has Been Updates in 70S Services, Has Mainly Been a Secondary Machine for Beans Only, Will Include a Headsight Kit to Run a Deere Draper1600
5Sold for $58,500 CAD = $40,432 USD, 2009 Massey Ferguson 9795, w/4200 P/U Header., 1253 Sep Hours1253
63200 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 & globe3200
Sheet1
Cell Formulas
RangeFormula
C2:C6C2=--TEXTAFTER("," &TEXTBEFORE(B2,"sep",,1),",",-1)
 
Upvote 0
It did fix those issues! But seemed to cause some others in different cells that didn't have issues before, Seems to not work on cells that use comma's in the number say 2,000 instead of just 2000. And also any cells where how the data is put in slightly different

Specs:
Combine, PRWD (4wd), ONLY 18hrs! Pro Drive Transmission, Tristream Rotor, Power Folding Covers, 22.5ft Unloading Auger, 650/85R38 Duals, 750/65R26 Rear Tires, Premium Cab and Visibility Package, Chopper, 18 eng. / 1 sep. Hours,Basic Warranty Through October 26th 2024, Engine Warranty Through October 26th 2025 or 2000hrs, Emissions Warranty Through October 26th 2028 or 3000hrs.

Specs:
PRWD Combine, PowerPlus CVT Drive Trans. w/HD Planetary & Diff Lock, HD CVT Drive Feederhouse w/Lateral Tilt & Stone Trap, Hyd. Fore/Aft, Ext. Wear Rotor, MagnaCut Fine Cut Chopper w/Deluxe Spreader & Windrow Chute, High Capacity Grain Tank Extensions, High Capacity Unload for 40ft. Headers w/Independent Cross Auger Control, 620/70R42 Front Tires w/Duals, 750/65R26 Rear Tires, Luxury Cab w/Leather Seat, Pro 700 Display, NAVII Controller, 262 Receiver, HID Stadium Lighting, 3,890 engine/2,804 separator hours, SN YCG215135, Location: McLeansboro, IL, Stock # 177328

And also still some issues with cells I had returning as 0 :

Specs:
4WD Combine, Harvest Command Combine Automation, PowerPlus Variable CVT Drive w/Feed Rate, Lateral Tilt Feederhouse w/Stone trap & Hyd. Fore/Aft, MagnaCut Fine Cut Chopper w/Dual Disc Spreaders, Chrome Cone w/Std. Cage, High-Capacity Grain Tank w/ Power Folding Covers, In-Cab Adjust Pivoting Spout, Independent Cross Auger Control, 620/70R42 Front Tires w/ Duals, 750/65R26 Rear Tires, Michelin Tires, 2-Speed Powered Rear Axle, Luxury Cab w/Heated & Ventilated Red Leather Seat, Premium LED Light Package, Distance Lights, Full Guidance w/Pro 700 Display, Nav Controller, 372 Receiver, 640 Engine/520 Separator hours, SN YNG247539, Location: Hopkinsville, KY, Stock # 21540
 
Upvote 0
Try
Book1
BC
3SN: 1H0S680SPC0747721, 650/85R38 w/Duals, 2WD, 750/65R26 Chopper CM P Fold Bin Ext, Pro Drive, 26' Unload, Prem. Cab, Auto Trac Ready, GreenStar 3 7" Display, Yield Mon, 3400 Sep. Hours3400
43000 Sep. Hours, Front Duals, Precision Ag Monitoring Upgrade System, Mud Hog 4WD System, Buddy Seat, Per Customers Sieve Replaced 20213000
5Integrated Auto Steer, 2313 Engine Hours, 1600 Separator Hours, 3 Speed Manual Transmission, 4WD 2 Speed, Heavy Duty Variable Speed FH, Hi-Capacity FH Lift Cylinders, Premium Header Control, Greenstar Harvest Monitoring System (no display or receiver included), Integrated Auto Trac Steering Valve, Touchset Concave Adjustment, Large Round Bar Concave Ext Wear, Gen Purpose Chaffer, 6.9M Unloading Auger Hi-Capacity, Fine Cut Chopper w/ Tailboard Spreader, Heavy Duty Final Drives, Rear Tires 28L-26 Firestones, Brand New Fron Duals 520/85R42 Firestones, 110V Coolant Heater, Clean Grain Auger and Fan Bottom Protection Package, LED Upper Cab Lights, 6090 9L Engine, Inspected and Maintained Annually by Sydenstrickers in Mexico, Can Provide 5 Years Past Service Records, Front Shoe Auger Plate Has Been Updates in 70S Services, Has Mainly Been a Secondary Machine for Beans Only, Will Include a Headsight Kit to Run a Deere Draper1600
6Sold for $58,500 CAD = $40,432 USD, 2009 Massey Ferguson 9795, w/4200 P/U Header., 1253 Sep Hours1253
73200 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 & globe3200
8Combine, PRWD (4wd), ONLY 18hrs! Pro Drive Transmission, Tristream Rotor, Power Folding Covers, 22.5ft Unloading Auger, 650/85R38 Duals, 750/65R26 Rear Tires, Premium Cab and Visibility Package, Chopper, 18 eng. / 1 sep. Hours,Basic Warranty Through October 26th 2024, Engine Warranty Through October 26th 2025 or 2000hrs, Emissions Warranty Through October 26th 2028 or 3000hrs.1
9PRWD Combine, PowerPlus CVT Drive Trans. w/HD Planetary & Diff Lock, HD CVT Drive Feederhouse w/Lateral Tilt & Stone Trap, Hyd. Fore/Aft, Ext. Wear Rotor, MagnaCut Fine Cut Chopper w/Deluxe Spreader & Windrow Chute, High Capacity Grain Tank Extensions, High Capacity Unload for 40ft. Headers w/Independent Cross Auger Control, 620/70R42 Front Tires w/Duals, 750/65R26 Rear Tires, Luxury Cab w/Leather Seat, Pro 700 Display, NAVII Controller, 262 Receiver, HID Stadium Lighting, 3,890 engine/2,804 separator hours, SN YCG215135, Location: McLeansboro, IL, Stock # 1773282804
104WD Combine, Harvest Command Combine Automation, PowerPlus Variable CVT Drive w/Feed Rate, Lateral Tilt Feederhouse w/Stone trap & Hyd. Fore/Aft, MagnaCut Fine Cut Chopper w/Dual Disc Spreaders, Chrome Cone w/Std. Cage, High-Capacity Grain Tank w/ Power Folding Covers, In-Cab Adjust Pivoting Spout, Independent Cross Auger Control, 620/70R42 Front Tires w/ Duals, 750/65R26 Rear Tires, Michelin Tires, 2-Speed Powered Rear Axle, Luxury Cab w/Heated & Ventilated Red Leather Seat, Premium LED Light Package, Distance Lights, Full Guidance w/Pro 700 Display, Nav Controller, 372 Receiver, 640 Engine/520 Separator hours, SN YNG247539, Location: Hopkinsville, KY, Stock # 21540520
Sheet6
Cell Formulas
RangeFormula
C3:C10C3=LET(t,TEXTSPLIT(SUBSTITUTE(B3,", ","|"),{"|","/"," "},,1),--INDEX(t,XMATCH(TRUE,ISNUMBER(SEARCH("sep",t)))-1))
 
Upvote 0
Solution
You don't need SUBSTITUTE.
Excel Formula:
=LET(t,TEXTSPLIT(B3,{", ","/"," "},,1),--INDEX(t,XMATCH(TRUE,ISNUMBER(SEARCH("sep",t)))-1))
 
Upvote 0

Forum statistics

Threads
1,224,828
Messages
6,181,217
Members
453,024
Latest member
Wingit77

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