Comparison Formula

S

Savio

I have a day entered in cell E2, and i am trying to write a formula to
return "T" if E2 is any value from Monday-Friday and "F" if not.

=IF(E2=OR("Monday","Tuesday","Wednesday","Thursday","Friday"),"T","F")

Could you tell me what's wrong with the above formula and how to
correct it.

thanks
 
L

Lars-Åke Aspelin

I have a day entered in cell E2, and i am trying to write a formula to
return "T" if E2 is any value from Monday-Friday and "F" if not.

=IF(E2=OR("Monday","Tuesday","Wednesday","Thursday","Friday"),"T","F")

Could you tell me what's wrong with the above formula and how to
correct it.

thanks

Try this:

=IF(OR(E2="Monday",E2="Tuesday",E2="Wednesday",E2="Thursday",E2="Friday"),"T","F")

Hope this helps / Lars-Åke
 
F

Fred Smith

If you want the formula shorter, I expect you could use:

=if(or(e2="Saturday",e2="Sunday"),"F","T")

Regards,
Fred.
 
L

Lars-Åke Aspelin

Try this:

=IF(OR(E2="Monday",E2="Tuesday",E2="Wednesday",E2="Thursday",E2="Friday"),"T","F")

Hope this helps / Lars-Åke

A bit shorter:

=IF(OR(E2={"Monday","Tuesday","Wednesday","Thursday","Friday"}),"T","F")

/ Lars-Åke
 
L

Lars-Åke Aspelin

For this to work you have assumed that E2 always holds a name of a day
and is never blank. That was not stated but can of course be true.

If that is the case, this formula is even shorter:

=IF(LEFT(E2,1)="S","F","T")

Lars-Åke
 

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