ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   IF/AND statement with a Countif included (https://www.excelbanter.com/excel-programming/454395-if-statement-countif-included.html)

Sabosis

IF/AND statement with a Countif included
 
Hello

I need a formula that can validate a cells contents and also do a count in a range to show me if that range is empty. What is the easiest way?


=if(and((A2="TT",Countif(a5:A8,0),"YES,""))) ....this obviously doesn't work but it is what I am trying to accomplish.

Thanks in advance for any help on how to achieve this

Claus Busch

IF/AND statement with a Countif included
 
Hi,

Am Tue, 6 Aug 2019 09:16:41 -0700 (PDT) schrieb Sabosis:

I need a formula that can validate a cells contents and also do a count in a range to show me if that range is empty. What is the easiest way?

=if(and((A2="TT",Countif(a5:A8,0),"YES,""))) ....this obviously doesn't work but it is what I am trying to accomplish.


you put the brackets wrong.
Try:
=IF(AND(A2="TT",COUNTIF(A5:A8,0)),"Yes","")


Regards
Claus B.
--
Windows10
Office 2016

Sabosis

IF/AND statement with a Countif included
 
On Tuesday, August 6, 2019 at 9:16:45 AM UTC-7, Sabosis wrote:
Hello

I need a formula that can validate a cells contents and also do a count in a range to show me if that range is empty. What is the easiest way?


=if(and((A2="TT",Countif(a5:A8,0),"YES,""))) ....this obviously doesn't work but it is what I am trying to accomplish.

Thanks in advance for any help on how to achieve this


Thanks. I am not getting an error, but I am not seeing a YES for when both conditions match either. I have TT in A2 and blanks in A5:A8. I would want to see YES for these conditions.

Claus Busch

IF/AND statement with a Countif included
 
Hi,

Am Tue, 6 Aug 2019 10:44:11 -0700 (PDT) schrieb Sabosis:

Thanks. I am not getting an error, but I am not seeing a YES for when both conditions match either. I have TT in A2 and blanks in A5:A8. I would want to see YES for these conditions.


then try:
=IF(AND(A2="TT",COUNTBLANK(A5:A8)0),"Yes","")
or
=IF(AND(A2="TT",COUNTIF(A5:A8,"")),"Yes","")


Regards
Claus B.
--
Windows10
Office 2016


All times are GMT +1. The time now is 11:46 AM.

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