Segment orderlines based on first - recurring orders

Makkafon

New Member
Joined
Sep 18, 2023
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Good day,

I have 3 columns: Customer ID, Product ID and Purchase Date.
I want a 4th column for Order type with 2 values: "First Order" and "Recurring order"

Task: Identify the 1st order in the last 12 months for a specific Product ID purchased by the same company, to understand what is the first buy vs subscription.

Been breaking my head trying to sort this, so hoping someone can tell me the best way to do this. Big dataset and each company has a multitude of orders, often for the same product. In short, i need to identify the first order date for each "Company ID" and "Product ID" match and return the first order as "New Order" and subsequent orders of the same product under the same company as "Recurring".

Cheers!
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Something like this perhaps?
Book1
ABCD
1Customer IDProduct IDPurchase dateRecurring?
2aaaPID 11/01/2023First Order
3aaaPID 22/01/2023First Order
4aaaPID 33/01/2023First Order
5aaaPID 14/01/2023Recurring Order
6aaaPID 15/01/2023Recurring Order
7aaaPID 16/01/2023Recurring Order
8aaaPID 27/01/2023Recurring Order
9aaaPID 38/01/2023Recurring Order
10bbbPID 19/01/2023First Order
11bbbPID 210/01/2023First Order
12bbbPID 311/01/2023First Order
13bbbPID 112/01/2023Recurring Order
14bbbPID 113/01/2023Recurring Order
15bbbPID 114/01/2023Recurring Order
16bbbPID 215/01/2023Recurring Order
17bbbPID 316/01/2023Recurring Order
18cccPID 117/01/2023First Order
19cccPID 218/01/2023First Order
20cccPID 319/01/2023First Order
21cccPID 120/01/2023Recurring Order
22cccPID 121/01/2023Recurring Order
23cccPID 122/01/2023Recurring Order
24cccPID 223/01/2023Recurring Order
25cccPID 324/01/2023Recurring Order
Sheet1
Cell Formulas
RangeFormula
D2:D25D2=IF(C2=MIN(IF((A:A=A2)*(B:B=B2),C:C)),"First Order","Recurring Order")
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,924
Members
452,366
Latest member
TePunaBloke

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