ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Comparison Formula (https://www.excelbanter.com/excel-discussion-misc-queries/218622-comparison-formula.html)

Savio

Comparison Formula
 
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

Lars-Åke Aspelin[_2_]

Comparison Formula
 
On Sat, 31 Jan 2009 12:52:34 -0800 (PST), Savio
wrote:

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","Thursda y","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

Fred Smith[_4_]

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

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

Regards,
Fred.

"Savio" wrote in message
...
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



Savio

Comparison Formula
 
its perfect !
thanks!

Lars-Åke Aspelin[_2_]

Comparison Formula
 
On Sat, 31 Jan 2009 20:56:48 GMT, Lars-Åke Aspelin
wrote:

On Sat, 31 Jan 2009 12:52:34 -0800 (PST), Savio
wrote:

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","Thursd ay","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


A bit shorter:

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

/ Lars-Åke

Lars-Åke Aspelin[_2_]

Comparison Formula
 
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


On Sat, 31 Jan 2009 15:04:20 -0600, "Fred Smith"
wrote:

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

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

Regards,
Fred.

"Savio" wrote in message
...
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




All times are GMT +1. The time now is 06:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com