How do I use a logical IF statement with TEXT in EXCEL

S

SchnidRoCK

I am working in Excel. I am trying to place a numerical value in a cell if
another cell has the text HPU.

For example: Cell D4 has the text string "75hp Diesel HPU", I want $40.00
to be placed in Cell B2. This is based on the Cell D4 having the text "HPU".

Do I use compare, IF, IS or what. Excel Help did not help me too much. Who
knows maybe this can not be done.
 
M

Marcelo

on B2

=if(isnum(search("hpu",d4)),40,0)

hope it helps
regards from Brazil
Marcelo

"SchnidRoCK" escreveu:
 
S

SchnidRoCK

Thank you Marcelo - but what appears in B2 is #NAME?. So I do not think it
worked. I copied and pasted the function from your response, so I know that
I got the function right.
 
B

Bernie Deitrick

SchnidRoCK,

There is no worksheet function "isnum"

=IF(ISNUMBER(SEARCH("hpu",D4)),40,0)

HTH,
Bernie
MS Excel MVP
 
M

Marcelo

sorry the mistake, ;-) my excel is in brazilian Portuguese...

regards

"Bernie Deitrick" escreveu:
 
S

SchnidRoCK

That fixed my problem thank you so much......

Marcelo said:
sorry the mistake, ;-) my excel is in brazilian Portuguese...

regards

"Bernie Deitrick" escreveu:
 

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