ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Smartening up an IF formula (https://www.excelbanter.com/excel-programming/424388-smartening-up-if-formula.html)

Stav19

Smartening up an IF formula
 
Hi All

I've the following IF formula which looks in Columns A:F and based on
what is in the Cell - "Yes" or "N/A", it will write "Yes" if "Yes" or
"N/A" is written in the cell and "O/S" if the row is empty:

=IF(OR(A1="Yes",B1="Yes",C1="Yes",D1="Yes",E1="Yes ",F1="Yes"),"Yes",IF
(OR(A1="N/A",B1="N/A",C1="N/A",D1="N/A",E1="N/A",F1="N/A"),"Yes","O/
S"))

My questions are as follows:

I think this works, but it seems quite a long winded way of doing it,
is there a way of simplifying it?

From testing it, it seemed to work if the row was completely empty, is
there a way to corporate the blank into the formula, or is it best to
leave it as it is?

Cheers in advance guys

Bob Phillips[_3_]

Smartening up an IF formula
 
=IF(OR(COUNTIF(A1:F1,"Yes")0,COUNTIF(A1:F1,"N/A")),"Yes","O/S")

--
__________________________________
HTH

Bob

"Stav19" wrote in message
...
Hi All

I've the following IF formula which looks in Columns A:F and based on
what is in the Cell - "Yes" or "N/A", it will write "Yes" if "Yes" or
"N/A" is written in the cell and "O/S" if the row is empty:

=IF(OR(A1="Yes",B1="Yes",C1="Yes",D1="Yes",E1="Yes ",F1="Yes"),"Yes",IF
(OR(A1="N/A",B1="N/A",C1="N/A",D1="N/A",E1="N/A",F1="N/A"),"Yes","O/
S"))

My questions are as follows:

I think this works, but it seems quite a long winded way of doing it,
is there a way of simplifying it?

From testing it, it seemed to work if the row was completely empty, is
there a way to corporate the blank into the formula, or is it best to
leave it as it is?

Cheers in advance guys




mdmackillop[_32_]

Smartening up an IF formula
 

How about
=IF(COUNTIF(A1:F1,"Yes")+COUNTIF(A1:F1,"N/A")0,"Yes","O/S")


--
mdmackillop
------------------------------------------------------------------------
mdmackillop's Profile: http://www.thecodecage.com/forumz/member.php?userid=113
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=66545


Stav19

Smartening up an IF formula
 
On Feb 19, 11:01*pm, mdmackillop
wrote:
How about
=IF(COUNTIF(A1:F1,"Yes")+COUNTIF(A1:F1,"N/A")0,"Yes","O/S")

--
mdmackillop
------------------------------------------------------------------------
mdmackillop's Profile:http://www.thecodecage.com/forumz/member.php?userid=113
View this thread:http://www.thecodecage.com/forumz/sh...ad.php?t=66545


Cheers guys, both viable options and do what I'm after!!!


All times are GMT +1. The time now is 10:40 PM.

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