![]() |
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 |
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 |
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 |
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 |
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 |
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 |
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