Extracting Characters from Cell

andreascostas

Board Regular
Joined
Jan 11, 2011
Messages
150
Hi
In column c I have a number of equations such as 2x + 20 . I need to pull out the 20 into another adjacent cell.
I used: =right(c1,len(c1)-Find(" + ",c1)) and it gives me the 20 .
The problem is that some of the equations have a negative in them ex. 4x - 19 or 2x - 6...and the formula above won't
work because it is looking for " +".....is there a way to get it to works with both at the same time???
Thanks
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Hi
In column c I have a number of equations such as 2x + 20 . I need to pull out the 20 into another adjacent cell.
I used: =right(c1,len(c1)-Find(" + ",c1)) and it gives me the 20 .
The problem is that some of the equations have a negative in them ex. 4x - 19 or 2x - 6...and the formula above won't
work because it is looking for " +".....is there a way to get it to works with both at the same time???
If there is always a space in front of that last number, you could use this formula...

=TRIM(RIGHT(SUBSTITUTE(C1," ",REPT(" ",99)),99))

Otherwise, try this...

=TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(C1,"-","+"),"+",REPT(" ",99)),99))
 
Upvote 0
Ok. Question. The first formula works with numbers I have in cell c1......when I try it to do the same thing
with numbers in b1 it does not work. ????? what does the 99 do in the formula/
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,199
Members
449,072
Latest member
DW Draft

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