Or's with If's Statements
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
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(I STEXT(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 "Sr Accountant" wrote: 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
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 "Sr Accountant" wrote in message ... 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
=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
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)" wrote in message ... =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
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 "PCLIVE" wrote: 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 "Sr Accountant" wrote in message ... 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
This works beautifully. Thank you for all the help. Have a great day!
Shelli "PCLIVE" wrote: 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)" wrote in message ... =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 |
All times are GMT +1. The time now is 09:22 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com