Using IF function with Text?

R

RussD

Hopefully this is an easy one, I have a column of text and numerical
data and I want to distinguish certain cells that contain the word
"Diesel".

My data looks like this:

Column C
2000cc 150 bhp
1900cc 120bhp
2000cc Diesel
2000cc 150 bhp
1900cc 120bhp
2000cc Diesel


Basically I want to duplicate the data in another column but where the
cell has Diesel in it I get a "D" and where the cell doesn't contain
the word diesel I get a "P".

I'm not sure if I should use lookup or the IF command, can anyone help
me please?

Thankyou in advance
 
M

Max

One way?

Put in say, D2: =IF(ISERROR(FIND("Diesel",C2)),"P","D")
copy down col D

hth
Max
 
D

Dan E

RussD,

The following will return D if C1 contains the word diesel and P
if it doesn't.

=IF(ISNUMBER(SEARCH("diesel",C1)),"D","P")

Dan E
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top