Thread: [Solved] Countif with 2 criteria
View Single Post
 
Old 05-23-2011, 02:06 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline Windows 7 32bit Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

Hi,
Quote:
What I want to happen is for the cell not to accept any input if G8 is not repeated and/or blank.
I don't fully understand what you mean by not to accept any input if G8 is not repeated'. At the moment you are checking if G8 occurs once:
=COUNTIF($G$2:$G$19,G8)=1

but, since G2:G19 intersects G8, for G8 to be repeated, shouldn't the check be:
=COUNTIF($G$2:$G$19,G8)>1

?


Depending on that, I think you want a data validation formula like this:
Code:
=AND(COUNTIF(G2:G17,G8)>1,NOT(ISBLANK(G8)))
If I misunderstood the G8 repeating logic then just adjust the COUNTIF() part of the formula.
Reply With Quote