If statement for fields with text

H

Hemant

Hi,

I need help with a if statement. The look up column contains one of 3 text
values - On time, Early, Late. I'm trying to use the OR function in the IF
statement i.e. If (I2 = OR(on time, early, late)), Complete, In progress).
However, the OR function only works with numerical values. Has anyone tried a
similar 'if' statement (with text) successfully? Please tell me how you made
it work.

Also, let me know if there is any other statement that I can use to
accomplish the above result.

Thanks in advance for your advice.
 
R

Ron Rosenfeld

Hi,

I need help with a if statement. The look up column contains one of 3 text
values - On time, Early, Late. I'm trying to use the OR function in the IF
statement i.e. If (I2 = OR(on time, early, late)), Complete, In progress).
However, the OR function only works with numerical values. Has anyone tried a
similar 'if' statement (with text) successfully? Please tell me how you made
it work.

Also, let me know if there is any other statement that I can use to
accomplish the above result.

Thanks in advance for your advice.

It is NOT true that "OR function only works with numerical values". The OR
function is a logical function evaluates Booleans.

A proper syntax for what you seem to want to do is:

=IF(OR(I2="on
time",I2="early",I2="late"),execute_if_any_true,execute_if_all_false)

or, a bit shorter:

=IF(OR(I2={"on time","early","late"}),execute_if_any_true,execute_if_all_false)




--ron
 

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