Extracting numbers based on different text

Spasmodic

Board Regular
Joined
Oct 22, 2013
Messages
83
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]R[/TD]
[TD]S[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]SS[/TD]
[TD]SS Notes[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]50 x 5[/TD]
[TD]IFERROR((LEFT(R3,SEARCH("'s x",[@[SS]])-1))/(1.0278-0.0278*REPLACE([@[SS]],1,FIND("x",[@[SS]]),"")),"")[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]50's x 5[/TD]
[TD]IFERROR((LEFT(R3,SEARCH("'s x",[@[SS]])-1))/(1.0278-0.0278*REPLACE([@[SS]],1,FIND("x",[@[SS]]),"")),"")[/TD]
[/TR]
</tbody>[/TABLE]

Hello all,

I was having trouble extracting numbers based on certain text. For example the formula in S2 and S3 only work when I write 50's x 5 or 100's x 5. If I put in 40 x 5 or 50 x 5 (without the 's) the formula doesn't work and while I could manual change the formula to just x (without the 's) it would take too long for the hundreds of cells that I have to do and there are some cases where it is 50's x 5 and 50 x 5. Curious if there is anyway to have excel distinguish between the two in 1 formula? I would prefer not to use VBA if possible. Thank you
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]R[/TD]
[TD]S[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]SS[/TD]
[TD]SS Notes[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]50 x 5[/TD]
[TD]IFERROR((LEFT(R3,SEARCH("'s x",[@[SS]])-1))/(1.0278-0.0278*REPLACE([@[SS]],1,FIND("x",[@[SS]]),"")),"")[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]50's x 5[/TD]
[TD]IFERROR((LEFT(R3,SEARCH("'s x",[@[SS]])-1))/(1.0278-0.0278*REPLACE([@[SS]],1,FIND("x",[@[SS]]),"")),"")[/TD]
[/TR]
</tbody>[/TABLE]

Hello all,

I was having trouble extracting numbers based on certain text. For example the formula in S2 and S3 only work when I write 50's x 5 or 100's x 5. If I put in 40 x 5 or 50 x 5 (without the 's) the formula doesn't work and while I could manual change the formula to just x (without the 's) it would take too long for the hundreds of cells that I have to do and there are some cases where it is 50's x 5 and 50 x 5. Curious if there is anyway to have excel distinguish between the two in 1 formula? I would prefer not to use VBA if possible. Thank you

S2=IFERROR(NUMBERVALUE(SUBSTITUTE(LEFT(R2,SEARCH(" x",R2)-1),"'s",""))/(1.0278-0.0278*NUMBERVALUE(RIGHT(R2,LEN(R2)-SEARCH("x",R2)))),"")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,849
Members
452,361
Latest member
d3ad3y3

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