View Single Post
  #19   Report Post  
Biff
 
Posts: n/a
Default

=MIN(1,COUNTIF(H5:L5,"=" &$F$1) - COUNTIF(H5:L5,"" &$H$1))

Hmmm...

If that works then so should:

=IF(SUMPRODUCT(--(MOD(COLUMN(H5:L5),2)=0),--(H5:L5=F1),--(H5:L5<=H1)),1,0)

I was accounting for the non-contiguous range and the possibilty of other
numeric data within the range, but even if you leave that out:

=IF(SUMPRODUCT(--(H5:L5=F1),--(H5:L5<=H1)),1,0)

That should also work.

I don't get it!

Biff

"Ron Rosenfeld" wrote in message
...
On Sat, 27 Aug 2005 01:33:01 -0700, "Pe66les"
wrote:

I tried your suggestion but it is still counting 1 when it should be 0,
This is what I typed:
=MIN(1,COUNTIF(H5:L5,"=" &$F$1) - COUNTIF(H5:L5,"<=" &$H$1))



What am I doing wrong?


Uh, you are NOT using the equation I posted. You have the comparison
operator
incorrect in your second COUNTIF function.

Assuming F1 contains your earlier date, and H1 contains your later date.

Change yours to:

=MIN(1,COUNTIF(H5:L5,"=" &$F$1) - COUNTIF(H5:L5,"" &$H$1))


--ron