View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Jdude Jdude is offline
external usenet poster
 
Posts: 2
Default If statement for alpha numeric combo AND numeric only

OMG...this is awesome! I love ya man! Thank you so much. I wanted a
formula so I didn't have to write a crazy macro....like replace CR, then go
to column and do text2columns....

Thank you...this will save so much time!


"Rick Rothstein" wrote:

Here is a formula that will do what you want...

=IF(RIGHT(B1,2)="cr",-LEFT(B1,LEN(B1)-2),B1)

--
Rick (MVP - Excel)


"Jdude" wrote in message
...
I need a formula that will strip out an alpha from a number:
B1=12,562.25CR
B2=25,235.44

I want one formula in column C that will do two things.
1) if there is a CR, take it off and multiply the remaining value by (-1)
=LEFT(B1,SEARCH("cr",B1)-1)*(-1)
2) if there isn't a CR, just give me the value in that cell

the expected results for the above would be:
C1= -12,562.25
C2= 25,235.44