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

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
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,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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