Excel 2003 SUMPRODUCT question

alright-stuff

New Member
Joined
Jul 26, 2009
Messages
22
Using excel 2003 I'm trying to count from a small table of data, the number of times certain occurrences happen within a date range. I am referring to 3 cells.

cell a1=start date
cell a2 =finish date
cell a3 =session (am or pm or all)


When using SUMPRODUCT I can count AM between certain dates and also PM between dates using:

...SUMPRODUCT((H11:H65336>=A1)*(H11:H65336<=A2)*(C11:C65336=A3))

I want to count AM and PM separately but will also need to count AM & PM together but cell A3 has a list validation dropdown with AM,PM and ALL as selections.

Also the column of which has the data only accepts AM or PM as a value, ALL in NOT a selection. I was thinking of using a criteria as any cell with a M in it but I understand wildcard characters can't be used in 2003.

The question is how do I capture occurrences when using my input cells if I select a date range from A1 and A2, and then I select ALL from A3? How does it capture both AM and PM occurrences matching my other criteria.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Using excel 2003 I'm trying to count from a small table of data, the number of times certain occurrences happen within a date range. I am referring to 3 cells.

cell a1=start date
cell a2 =finish date
cell a3 =session (am or pm or all)


When using SUMPRODUCT I can count AM between certain dates and also PM between dates using:

...SUMPRODUCT((H11:H65336>=A1)*(H11:H65336<=A2)*(C11:C65336=A3))

I want to count AM and PM separately but will also need to count AM & PM together but cell A3 has a list validation dropdown with AM,PM and ALL as selections.

Also the column of which has the data only accepts AM or PM as a value, ALL in NOT a selection. I was thinking of using a criteria as any cell with a M in it but I understand wildcard characters can't be used in 2003.

The question is how do I capture occurrences when using my input cells if I select a date range from A1 and A2, and then I select ALL from A3? How does it capture both AM and PM occurrences matching my other criteria.
If there are no empty cells in column C and the only possible entries are either AM or PM then you really don't need to count column C when "ALL" is selected. You can just count the dates that fall within the date boundaries.

Try something like this:

=IF(A3="ALL",SUMPRODUCT(--(H11:H65336>=A1),--(H11:H65336<=A2)),SUMPRODUCT(--(H11:H65336>=A1),--(H11:H65336<=A2),--(C11:C65336=A3)))
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,707
Members
452,939
Latest member
WCrawford

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top