Macro help

R

Ro

Hi!

I have a table with customers that have made multiple purchases of
different products. I would like to have a macro that creates a
purchase number based on the number of times they have purchased
individual items. For example, the first time they purchase Product A a
1 would go in this new field, the second time they purchase ProductA a
2 would go in this field. I understand this would work through a date
loop but I am lost as to how to accomplish this. I am not really
familiar with writing macro's!
Another key thing is that in order for it to be a purchase it must not
have been a sample so Amount$<>0. Purchase# is how I would like the end
result..

Data:
Customer# Product# Date Purchase# Amount$
201 A 01/01/2001 1
345.00
201 A 08/12/2004 2
981.00
201 B 07/11/2003
0
203 C 05/07/2005
0
203 B 24/11/2005 1
284.00
204 C 17/06/2004 1
789.00
204 C 24/09/2004
0
204 B 15/05/2005 1
320.00
204 B 28/10/2005 2
414.00
204 C 01/02/2005 2
940.00
204 A 14/06/2005 1
392.00


I have thousands of customers with hundreds of purchases. Thanks to
anyone that can help me out!!!!!!!! :):)
 
D

Don Guillett

Actually, you would need to use sumproduct
=sumproduct((a2:a200="yourcustomer")*1) to count
=sumproduct((a2:a200="yourcustomer")*c2:c200) to total the sales
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top