View Full Version : Counting Problem - Number of Entries for Several Time Periods


mz-ler
01-27-2006, 06:32 AM
Hi - I don't seem to be able to find a solution which should (I think) be simple.

I want to find out how many sales occured between two points in time. The problem now is that I do not only habe one sales period but several. E.g. i have 5 periods each with a start and an end date - In a separate table there are a couple of hundred sales. Is there a way to simply count for each period without doing COUNTIF with some OR conditions (because I have a lot more than those five periods to cover).

Help is very much appreciated!
Thanks

SMatthews
01-27-2006, 09:56 AM
I'd guess that you need to use sumproduct. I'd have a place to define your date ranges. For example, you define your ranges in Row 1 and Row 2 (start, end) where A1 is the start date for period one, B1 for period two, etc., and A2 would be the end date of the period. From there you use sumproduct like this: =SUMPRODUCT((([date range]>=[start date])*([date range]<=[end date]))*([sales range]))

Does this make sense? There's probably a cleaner way of doing this, but this is all I got.