View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier[_3_] Roger Govier[_3_] is offline
external usenet poster
 
Posts: 2,480
Default COUNTIF by date range problem

Hi

If the data is the same, the results will be the same.
Perhaps you have some data which is outside the week?
Perhaps you have a Text value of 5 rather than numeric in one of the rows?

--
Regards
Roger Govier

"LoriB" wrote in message
...
Thanks Roger, that does work. The weird thing is that when I use that
formula I get different results compared to a report that uses the same
data
for 1 week and a COUNTIF formula (=COUNTIF(B2:B1000,"5")
I do you have any idea why the results would be different?

Thanks again

"Roger Govier" wrote:

Hi

Sorry, typo in my formula
try
=SUMPRODUCT(($A2:$A$1000=$D2)*($A$2:$A$1000<=$D2+ 6)*($B$2:B$10005))
Returned a result of 13 with your data.
--
Regards
Roger Govier

"LoriB" wrote in message
...
Thanks for your help but I'm sorry, this formula returns incorrect
result.
When I try in test data a COUNTIF statement finds 147, this formula
finds
none. Again, I wonder if the sumproduct is adding and not counting.

My data looks like this:
Date Minutes
7/1/2008 35.53
7/1/2008 6.78
7/1/2008 4.00
7/1/2008 32.43
7/1/2008 32.75
7/1/2008 25.68
7/1/2008 13.72
7/1/2008 18.33
7/1/2008 6.57
7/1/2008 8.65
7/1/2008 37.65
7/1/2008 27.43
7/1/2008 21.83
7/1/2008 19.55

I'm trying to find out how many times the time column shows less 5, in
the
example since it's 14 rows & only 1 is less than 5 the result returned
should
be 13.

I hope that makes things clearer.

Thank you for your help.

"ShaneDevenshire" wrote:

Hi,

Here is a formula that should get you the % of items in a given week
that
exceed 5 minutes:

=SUMPRODUCT(--(A$2:A$26=E1),--(A$2:A$26<=E2),--(B$2:B$265))/SUMPRODUCT(--(A$2:A$26=E1),--(A$2:A$26<=E2))

A2:A26 is the date range, B2:B26 is the minute range. E1 contains the
starting date of the week you want, E2 contains the ending date of
that
week.
You can enter these each week to get your results. You will
highlight a
much larger range but it makes no difference. Format the formula cell
to
%.

There is one possible complication, this formula assumes minutes are
entered
as numbers such as 1, 3, 11 or 2.5, but not as times 8:03.

If this helps, please click the Yes button.

Thanks,
Shane Devenshire


"LoriB" wrote:

Hello,

I have a sheet that shows data for several months, it has multiple
instances
of each day (7/1/2008 may appear in 40 rows) as the data is from
different
sources. It has another column that shows the amount of time an
even
happened for each date in minutes. I need to filter this
information
by week
and by the count of times 5 minutes to get the percent of time 5
minutes
this even happened each week. Just to make matters more difficult
the
data
will be updated each week, thankfully it will be added to the end of
the
table so I can just past down the formula.
I'd really appreciate some help with this because a COUNTIF formula
keeps
returning errors.
Thank you