Extracting numbers based on different text

Spasmodic

Board Regular
Joined
Oct 22, 2013
Messages
83
RS
1SSSS Notes
250 x 5IFERROR((LEFT(R3,SEARCH("'s x",[@[SS]])-1))/(1.0278-0.0278*REPLACE([@[SS]],1,FIND("x",[@[SS]]),"")),"")
350's x 5IFERROR((LEFT(R3,SEARCH("'s x",[@[SS]])-1))/(1.0278-0.0278*REPLACE([@[SS]],1,FIND("x",[@[SS]]),"")),"")

<tbody>
</tbody>

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

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
RS
1SSSS Notes
250 x 5IFERROR((LEFT(R3,SEARCH("'s x",[@[SS]])-1))/(1.0278-0.0278*REPLACE([@[SS]],1,FIND("x",[@[SS]]),"")),"")
350's x 5IFERROR((LEFT(R3,SEARCH("'s x",[@[SS]])-1))/(1.0278-0.0278*REPLACE([@[SS]],1,FIND("x",[@[SS]]),"")),"")

<tbody>
</tbody>

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,216,073
Messages
6,128,637
Members
449,461
Latest member
kokoanutt

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