Countif using a cell reference as range

J

J.W. Aldridge

=COUNTIF(formalin_count,"<=d$2")

formalin_count consist of a string of times (F6:F64999)
ie 07:00 - 19:00

d2 consist of a time (the end/max time). (18:00)

I am trying to get the count of instances up until the time given in
D2.

The question is how to get this to read the reference D$2 ?

thanx
 
T

T. Valko

=COUNTIF(formalin_count,"<=d$2")

Try it like this:

=COUNTIF(formalin_count,"<="&D$2)
 
P

Pete_UK

Do you mean that you want to count if the time in D2 falls within the
range of times in each cell in formalin_count? What if the time is
equal to the end time in the range? Presumably if the range is 18:00 -
21:00 this would not count?

Pete
 
I

Infinitogool

Hi J.W. Aldridge

Try something like this:
=COUNTIF(formalin_count,"<="&d$2)

Regards,
Pedro J.
 
P

Pete_UK

If F6, the first cell in the range formalin_count, contains "07:00 -
19:00" (i.e. a text value) and D2 contains 18:00 (a time value) then
you won't be able to use COUNTIF directly. You'll have to extract the
start and end times out of F6 and then see if D2 is within the range
(if that's what you are trying to do - see my earlier questions). This
will probably be a sumproduct formula.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top