find text, display text

S

shaun

I want to find text within a cell and, if found, display a text message of my
choosing. For instance, if A1 has the txt "Special Price", then I want B1 to
say, "Special." If it says "Regular Price", I want B1 to say "Reg."
Thanks!
 
M

Max

One way

Put in B1:

=IF(TRIM(A1)="Special Price","Special",IF(TRIM(A1)="Regular
Price","Reg",A1))

Above assumes that A1 contains neither Special Price"
nor "Regular Price", the value in A1 is to be returned
 
M

Max

Above assumes that A1 contains neither Special Price"
nor "Regular Price", the value in A1 is to be returned

Oops, typo (missing "if") in above lines, should read as:
 
Top