ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Include several choices in an IF statement. (https://www.excelbanter.com/excel-worksheet-functions/9066-include-several-choices-if-statement.html)

kevin

Include several choices in an IF statement.
 
Once again thanks for your help folks. Could someone show me how to write the
following if statement. =IF(A1=RED OR BLUE OR GREEN OR BLACK OR ORANGE,1,0)
I know these would all need to be in "" but I am not sure what separator to
use.
--
Thanks Kevin

RagDyer

Try this:

=IF(OR(A1={"RED","BLUE","GREEN","BLACK","ORANGE"}) ,1,0)

I'm sure you're talking Text here, and *not* the actual colors of the cell.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

"kevin" wrote in message
...
Once again thanks for your help folks. Could someone show me how to write
the
following if statement. =IF(A1=RED OR BLUE OR GREEN OR BLACK OR ORANGE,1,0)
I know these would all need to be in "" but I am not sure what separator to
use.
--
Thanks Kevin


kevin

Thanks very much, and yes I was talking about text. Thanks again for your help.
Kevin

"RagDyer" wrote:

Try this:

=IF(OR(A1={"RED","BLUE","GREEN","BLACK","ORANGE"}) ,1,0)

I'm sure you're talking Text here, and *not* the actual colors of the cell.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

"kevin" wrote in message
...
Once again thanks for your help folks. Could someone show me how to write
the
following if statement. =IF(A1=RED OR BLUE OR GREEN OR BLACK OR ORANGE,1,0)
I know these would all need to be in "" but I am not sure what separator to
use.
--
Thanks Kevin



RagDyer

Thank you for the feed-back.
--


Regards,

RD
--------------------------------------------------------------------
Please keep all correspondence within the Group, so all may benefit!
-------------------------------------------------------------------

"kevin" wrote in message
...
Thanks very much, and yes I was talking about text. Thanks again for your
help.
Kevin

"RagDyer" wrote:

Try this:

=IF(OR(A1={"RED","BLUE","GREEN","BLACK","ORANGE"}) ,1,0)

I'm sure you're talking Text here, and *not* the actual colors of the

cell.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

"kevin" wrote in message
...
Once again thanks for your help folks. Could someone show me how to write
the
following if statement. =IF(A1=RED OR BLUE OR GREEN OR BLACK OR

ORANGE,1,0)
I know these would all need to be in "" but I am not sure what separator

to
use.
--
Thanks Kevin




kevin

One more complication, when using this formula in say cell d1, and if there
is no value in a1 it returns a 0 in d1, is there a way to include an (ifblank
, return a blank,) statement in the formula so that nothing appears in the
cell until an entry is made in the input cell. Just so that there is not a
long string of 0's.

Thanks Kevin

"RagDyer" wrote:

Try this:

=IF(OR(A1={"RED","BLUE","GREEN","BLACK","ORANGE"}) ,1,0)

I'm sure you're talking Text here, and *not* the actual colors of the cell.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

"kevin" wrote in message
...
Once again thanks for your help folks. Could someone show me how to write
the
following if statement. =IF(A1=RED OR BLUE OR GREEN OR BLACK OR ORANGE,1,0)
I know these would all need to be in "" but I am not sure what separator to
use.
--
Thanks Kevin



RagDyeR

Just replace the last 0 in the formula with a null ( "" ).

=IF(OR(A1={"RED","BLUE","GREEN","BLACK","ORANGE"}) ,1,"")
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"kevin" wrote in message
...
One more complication, when using this formula in say cell d1, and if there
is no value in a1 it returns a 0 in d1, is there a way to include an
(ifblank
, return a blank,) statement in the formula so that nothing appears in the
cell until an entry is made in the input cell. Just so that there is not a
long string of 0's.

Thanks Kevin

"RagDyer" wrote:

Try this:

=IF(OR(A1={"RED","BLUE","GREEN","BLACK","ORANGE"}) ,1,0)

I'm sure you're talking Text here, and *not* the actual colors of the

cell.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

"kevin" wrote in message
...
Once again thanks for your help folks. Could someone show me how to write
the
following if statement. =IF(A1=RED OR BLUE OR GREEN OR BLACK OR

ORANGE,1,0)
I know these would all need to be in "" but I am not sure what separator

to
use.
--
Thanks Kevin





kevin

Thanks very much RagDyeR.

Kevin

"RagDyeR" wrote:

Just replace the last 0 in the formula with a null ( "" ).

=IF(OR(A1={"RED","BLUE","GREEN","BLACK","ORANGE"}) ,1,"")
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"kevin" wrote in message
...
One more complication, when using this formula in say cell d1, and if there
is no value in a1 it returns a 0 in d1, is there a way to include an
(ifblank
, return a blank,) statement in the formula so that nothing appears in the
cell until an entry is made in the input cell. Just so that there is not a
long string of 0's.

Thanks Kevin

"RagDyer" wrote:

Try this:

=IF(OR(A1={"RED","BLUE","GREEN","BLACK","ORANGE"}) ,1,0)

I'm sure you're talking Text here, and *not* the actual colors of the

cell.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================

"kevin" wrote in message
...
Once again thanks for your help folks. Could someone show me how to write
the
following if statement. =IF(A1=RED OR BLUE OR GREEN OR BLACK OR

ORANGE,1,0)
I know these would all need to be in "" but I am not sure what separator

to
use.
--
Thanks Kevin







All times are GMT +1. The time now is 07:21 AM.

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