Or's with If's Statements

Or's with If's Statements

Post by U3IgQWNjb3 » Sat, 23 Jun 2007 13:46:01


I am trying to write an if statement for a range of cells, so that if any one
of the 6 cells has a certain word in them, my destination cell (where my
formula is written), will give my staff members a certain command. Is there
a way to do this with an 'if' statement, or does anyone have other
suggestions?

Any help you can give me would be much appreciated. Thank you in advance.
Shelli - Senior Accountant
 
 
 

Or's with If's Statements

Post by RmxvTU0 » Sat, 23 Jun 2007 14:07:01

Sr Accountant,
This is what I came up with:
Cells A11 thru F11 blank,
In cell G11
"=IF(ISTEXT(A11)=TRUE,1,IF(ISTEXT(B11)=TRUE,2,IF(ISTEXT(C11)=TRUE,3,IF(ISTEXT(D11)=TRUE,4,IF(ISTEXT(E11)=TRUE,5,IF(ISTEXT(F11)=TRUE,6,0))))))"
This looks at each cell one at a time, if there is text in it, it outputs a
corresponding number. To change the command, depending on the response. Just
change the number to the command.
hth

 
 
 

Or's with If's Statements

Post by PCLIV » Sat, 23 Jun 2007 14:25:53

If the certain word exist in the cell, will it be the only word in the
cell...or might there be other words along with it? If the text string you
are searching for will not contain any other text along with it, then:

=IF(COUNTIF(A1:A6,"CertainWord")>0,"Word exists.","Word does NOT exist.")

HTH,
Paul
 
 
 

Or's with If's Statements

Post by MVP - » Sat, 23 Jun 2007 14:33:23

> =IF(COUNTIF(A1:A6,"CertainWord")>0,"Word exists.","Word does NOT exist.")

You can leave the >0 out and it will still work, right?

Rick
 
 
 

Or's with If's Statements

Post by PCLIV » Sat, 23 Jun 2007 14:41:36

This is true. It's jkind of a habit of mine to include the operator in
there, even when it's only necessary to check true or false. Thanks for
pointing that out.


"Rick Rothstein (MVP - VB)" < XXXX@XXXXX.COM > wrote in
 
 
 

Or's with If's Statements

Post by U3IgQWNjb3 » Sat, 23 Jun 2007 23:05:01

There will be three options, "Cash Post", "Do Not Cash Post" or Blank.
Nothing else should appear in the cells. I will give your ideas a try.

Thank you,
Shelli
 
 
 

Or's with If's Statements

Post by U3IgQWNjb3 » Sat, 23 Jun 2007 23:18:03

This works beautifully. Thank you for all the help. Have a great day!
Shelli