Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old August 6th 19, 05:16 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2008
Posts: 44
Default 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

  #2   Report Post  
Old August 6th 19, 05:32 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2011
Posts: 3,695
Default 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
  #3   Report Post  
Old August 6th 19, 06:44 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2008
Posts: 44
Default 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.
  #4   Report Post  
Old August 6th 19, 08:26 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2011
Posts: 3,695
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Countif within and if statement Amber Excel Worksheet Functions 2 July 30th 07 06:05 PM
countif statement italiavb Excel Worksheet Functions 4 July 14th 06 01:57 PM
If Statement with Countif Crazyhorse Excel Discussion (Misc queries) 3 April 10th 06 08:55 PM
Countif statement Steved Excel Worksheet Functions 11 September 28th 05 10:10 PM
Can Excel cell formatting be included in an IF statement? neeses Excel Worksheet Functions 3 September 21st 05 07:42 PM


All times are GMT +1. The time now is 11:30 PM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017