AND/OR function with blank cells

olympiac

Board Regular
Joined
Sep 26, 2010
Messages
158
Hi,

I need a function that returns in cell A1 "TRUE" if the values in the range A2:A60 are "No" or Blank cell or a mix of both.
If there are cells that contain another value, the function will return "FALSE".

I think that I am supposed to use the AND function. Do I need to combine it with a OR Function?

Can you help please?

Thanks
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi,

I need a function that returns in cell A1 "TRUE" if the values in the range A2:A60 are "No" or Blank cell or a mix of both.
If there are cells that contain another value, the function will return "FALSE".

I think that I am supposed to use the AND function. Do I need to combine it with a OR Function?

Can you help please?

Thanks
Do you mean if EVERY cell in the range is either blank or contains No then return TRUE or do you mean if ANY cell in the range is either blank or contains No then return TRUE.
 
Upvote 0
Let's be clear, do you want the single cell A1 to hold the results of the analysis for the whole of A2:A60 ?
So, for example, if A20 contains "YES", then A1 should show FALSE ?

If that's what you want, maybe
Code:
=if((countif(a2:a60,"")+countif(a2:a60,"No"))=59,TRUE,FALSE)
 
Upvote 0
This version would avoid you having to include a count of the range (59) in case that changes

=SUMPRODUCT(((A2:A60<>"No")+(A2:A60<>"")=2)+0)=0
 
Upvote 0
Here is the scenario:

<table cellspacing="0" cellpadding="0" border="0" width="128"><col style="width:48pt" span="2" width="64"> <tbody><tr style="height:12.75pt" height="17"> <td class="xl22" style="height:12.75pt;width:48pt" height="17" width="64">Cell A1</td> <td class="xl23" style="border-left:none;width:48pt" align="center" width="64">TRUE</td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl22" style="height:12.75pt;border-top:none" height="17">Cell A2</td> <td class="xl22" style="border-top:none;border-left:none">no</td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl22" style="height:12.75pt;border-top:none" height="17">Cell A3</td> <td class="xl22" style="border-top:none;border-left:none">no</td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl22" style="height:12.75pt;border-top:none" height="17">Cell A4</td> <td class="xl22" style="border-top:none;border-left:none">no</td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl22" style="height:12.75pt;border-top:none" height="17">Cell A5</td> <td class="xl22" style="border-top:none;border-left:none">no</td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl22" style="height:12.75pt;border-top:none" height="17">Cell A6</td> <td class="xl22" style="border-top:none;border-left:none"> </td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl22" style="height:12.75pt;border-top:none" height="17">Cell A7</td> <td class="xl22" style="border-top:none;border-left:none">no</td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl22" style="height:12.75pt;border-top:none" height="17">Cell A8</td> <td class="xl22" style="border-top:none;border-left:none"> </td> </tr> <tr style="height:12.75pt" height="17"> <td class="xl22" style="height:12.75pt;border-top:none" height="17">Cell A9</td> <td class="xl22" style="border-top:none;border-left:none"> </td> </tr> </tbody></table>etc

If cell A7 for instance contains the value "xxxx" then the function will return FALSE.
 
Upvote 0
Great, thanks for letting us know.
Bear in mind Barry's point - my suggestion includes the number 59 because that's how many rows you said you had. If the number of rows is variable, you'll need to allow for that somehow, and Barry's suggestion does that automatically.
 
Upvote 0
Or try this (array formula - use Ctrl+Shift+Enter and not only Enter):

=SUM(--(A2:A60="no")+--(A2:A60=""))-ROWS(A2:A60)=0

Markmzz
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,683
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top