want to see if a range doesn't contains any values other than this

banneduser123

Banned - Rules violations
Joined
Mar 29, 2006
Messages
181
hi,

can't figure this out.

I want to create a formula that will check all of column A, to see if it contains any values other than "October".

So here's an example:

Column A
October
October
March
October
April


In the example above, the formula should return ether "Yes" or "No". That doesn't matter, i just don't know how to write a formula that says if this range contains any values other than "October", then tell me "Yes".


hope that was clear..
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Try
=IF(COUNTIF(A1:A10,"October")=COUNTA(A1:A10), "No", "Yes)

or if you want a blank cell to trigger the Yes response, hard code in the 10.
 
Last edited:
Upvote 0
hey Mike, thanks for the response.

tried applying this formula, but not really sure how it's working....doesn't seem to accomplish what i was looking for.
can you explain what your formula does?
 
Upvote 0
The formula was missing a quote mark. Try the one below (I've give 2 examples) . If it is not what you want, be more specific about what went wrong and perhaps give your (small) sample data and the expected results.

Excel Workbook
ABCDE
1OctoberYesOctoberNo
2OctoberOctober
3MarchOctober
4OctoberOctober
5AprilOctober
6October
7October
8October
9October
10October
Same Values
 
Upvote 0
Hi Peter,

thanks for helping.

i tried the formula in a new workbook and it worked fine, it's not working in the file i actually need it in...not sure why. at first i thought it was cause i wasn't factoring in the header of the column, but i dont know.


also not sure how you entered tables in your post...


so i have two files.

File 1 has a column of values that I want to look through.
File two is where I have the formula i want to create.

File 1, column B:

B1: Term
B2: 1 Year
B3: 1 Year
B4: 1 Year
B5: 1 Year



File 2:

A1: formula will look in column B of File 1, is there are any values others than "1 Year" and "Term", then return "Yes"



was this clear?
 
Upvote 0
when i click on evaluate formula, it shows me the countif is coming out to 756, but the counta shows as 757..the counta always comes up with one count more no matter how much i toy around with this...

'=IF(COUNTIF('[Working Paper 083119.xlsx]Raw'!$G:$G,"GT 1 YEAR")*COUNTA('[Working Paper 083119.xlsx]Raw'!$G:$G),"no","yes")
same with
'=IF(COUNTIF('[Working Paper 083119.xlsx]Raw'!$G$2:$G$2000,"GT 1 YEAR")*COUNTA('[Working Paper 083119.xlsx]Raw'!$G$2:$G$2000),"no","yes")


also, even if i change the formula to be this, it still always returns the value as true

'=IF(COUNTIF('[Working Paper 083119.xlsx]Raw'!$G$2:$G$2000,"GT 1 YEAR")*COUNTA('[Working Paper 083119.xlsx]Raw'!$G$3:$G$2000),"no","yes")
 
Last edited:
Upvote 0
Try
=IF(COUNTIF(A1:A10,"October")=COUNTA(A1:A10), "No", "Yes)
Spreadsheet Formulas
CellFormula
B1=IF(COUNTIF(A1:A10,"October")=COUNTA(A1:A10), "No", "Yes")

<tbody>
</tbody>

<tbody>
</tbody>
Am I missing something... why not use the COUNTIFS function?

=IF(COUNTIFS(A1:A10,"<>October",A1:A10,"<>"),"Yes","No")
 
Upvote 0
looks like it's working properly with this:


=IF(COUNTIF('[Working Paper 083119.xlsx]Raw'!$G2:$G2222,"GT 1 YEAR")=COUNTA('[Working Paper 083119.xlsx]Raw'!$G2:$G2222),"no","yes")


not really sure where i was making my mistake, but thanks for the help everyone!
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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