View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default Counting Records Between Two Dates

The way you had it you were comparing D1:D999 with 1/1/2008, which Excel
interprets as 1 divided by 1 divided by 2008. To overcome this you need to
put 1/1/2008 within quotes, but then this will not be in the correct format.
The double unary minus, or --, converts this into a value, but you could
have used *1, or +0, or even VALUE( ... ) to convert it. The other formula I
gave you used the DATE function, as another way to achieve the result.

The other differences with your formula were the use of brackets.

Hope this helps.

Pete


"Stevo" wrote in message
...
really appreciate the help - overwhelming response. I picked Pete Uk's
solution at random and it worked great. It seems that one of the
differences
between Pete's suggestion and my original attempt was hte inclusion of
dashes
(-----), can anybody please tell me what do these represent in the sum
product function?

Best regards

Steve

"Stevo" wrote:

Hi,

I have a long list of records all on the same worksheet. In column d are
the categories I want to search on (e.g. apples). I am tryoing to found
out
how many apples between 01/01/2008 and 31/01/2008. I have tried

=SUMPRODUCT((D1:D999)=1/1/2008)*((D1:D999)<=31/12/2008)*(G1:G999="apples")

This returns 0 even though there are apples in column g between these
dates.

Can somebody please help?

Best regards

Steve