Need help with DCOUNT or COUNTIF, XL2007/XP

joeymu

New Member
Joined
Aug 4, 2011
Messages
1
I have an orders table with columns: order ID, name, email, product, and date. My customers sometimes reorder products many weeks or months after their initial order. Thus, customers who placed initial orders in December may reorder in January and again in March and again in June. I am interested in tracking orders from customers who placed initial orders in December as well as follow up orders later. For now, I am NOT interested in initial orders placed in other months.

To count how many customers ordered in December and also placed reorders some time later, I have successfully used the following:

Placed just one order:
{=SUM(IF(COUNTIF($H:$H,$H$92:$H$576)=1,1,0))}

Placed exactly two orders:
=SUM(IF(COUNTIF($H:$H,$H$92:$H$576)=2,1,0))

... exactly three orders:
=SUM(IF(COUNTIF($H:$H,$H$92:$H$576)=3,1,0))

... and so on...

... WHERE column H contains email addresses--our unique identifier for customers--and range H92:H576 corresponds to December orders only.

Using SUMPRODUCT I was able to determine that 484 customers who placed initial orders in December ended up placing 774 total orders through June. This means there were 484 initial orders in December and 290 reorders beyond December. (Our product has a production cycle of more than 30 days, so it is unlikely for customers to place two orders in the same month.)

Now I need to get counts of the products these customers ordered in December and beyond.

This formula returns counts of each product ordered ONLY in December:
=COUNTIF($I$92:$I$576,"Product1")
=COUNTIF($I$92:$I$576,"Product2")
=COUNTIF($I$92:$I$576,"Product3") ... and so on... ... where column I contains product names...

And this formula returns counts of each product ordered across all time:
=COUNTIF($I:$I,"Product1")
=COUNTIF($I:$I,"Product2")
=COUNTIF($I:$I,"Product3")

But I need to count the products that my December customers bought in December AND beyond. This is where I'm stuck. Perhaps the solution involves DCOUNTA or COUNTIF with multiple criteria?

Thanks in advance. I really appreciate it!
 

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.

Forum statistics

Threads
1,224,606
Messages
6,179,862
Members
452,948
Latest member
UsmanAli786

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