View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
gumgisen gumgisen is offline
external usenet poster
 
Posts: 4
Default Count no. of occurance in 2 dynamic columns within a data period

The setup of the worksheet is as follows:
Col A Col B Col C Col D
Apple 12/09/2009 Start date No. of Apple within data period
Orange 08/09/2009 End date No. of Orange within data period
Apple 05/09/2009
Banana 21/07/2009
Apple 23/09/2009
etc.. etc...

Both column A and B retrieve data from a query linked to an Access database
so the number of rows in those columns may change whenever I refresh the
query.

I have to count of the number of "fruit" occurance (Formula entered at D1
and D2) within a certain week which start date and end date are entered in
C1 & C2 respectively. I read some other posts in this forum and wrote the
forumla below:

=SUMPRODUCT(--(COUNTIF($B:$B,WEEKNUM($B:$B)=WEEKNUM($C$1)),--COUNTIF($A:$A,"Apple"))

And the result is #NUM!

Can someone please help? Thank you