BloodyBill
New Member
- Joined
- Oct 5, 2020
- Messages
- 35
- Office Version
- 365
- Platform
- Windows
Hi,
I have a growing data set of 24K+ transactions made by more than 3,200 customers. I want to see an average number of units purchased by each customer. Easy. A pivot table with data summarized by average does the trick.
Except, I want to see the average based on recency. In other words, if Customer A has 35 transactions in the data set, what is the average of his last 4 transactions? His last 5? His last 3? I don't want to filter by date, because that might eliminate infrequent customers whose data is spread out over time.
Also, I need one more thing: If I'm averaging all the customers' most recent 5 transactions, but new Customer Q only has 3 or 4 transactions, I need the average of whatever I can get.
The dummy data below is pretty close to what I have: A transaction date. A unique customer identifier. And number of products at each transaction. (BTW, never more than one transaction per day.) The only difference is that I have 24K lines of data (transactions) and 3,200 customer identifiers.
Any help? (Especially non-VBA solutions).
Thanks!!
I have a growing data set of 24K+ transactions made by more than 3,200 customers. I want to see an average number of units purchased by each customer. Easy. A pivot table with data summarized by average does the trick.
Except, I want to see the average based on recency. In other words, if Customer A has 35 transactions in the data set, what is the average of his last 4 transactions? His last 5? His last 3? I don't want to filter by date, because that might eliminate infrequent customers whose data is spread out over time.
Also, I need one more thing: If I'm averaging all the customers' most recent 5 transactions, but new Customer Q only has 3 or 4 transactions, I need the average of whatever I can get.
The dummy data below is pretty close to what I have: A transaction date. A unique customer identifier. And number of products at each transaction. (BTW, never more than one transaction per day.) The only difference is that I have 24K lines of data (transactions) and 3,200 customer identifiers.
Any help? (Especially non-VBA solutions).
Thanks!!
Date | Customer | Products purchased |
5/15/2024 | A | 2 |
5/15/2024 | B | 2 |
5/14/2024 | C | 1 |
4/30/2024 | A | 3 |
3/3/1901 | B | 1 |
11/17/1900 | C | 1 |
11/11/1900 | A | 3 |
3/5/2024 | B | 2 |
2/26/2024 | C | 3 |
2/15/2024 | A | 2 |
2/14/2024 | B | 1 |
2/2/2024 | C | 1 |
1/31/2024 | A | 3 |
1/31/2024 | B | 1 |
1/27/2024 | C | 1 |
1/28/2024 | A | 3 |
1/12/2024 | B | 2 |
1/2/2024 | C | 3 |