Search code examples
google-sheetsgoogle-sheets-formulaformulaspreadsheet

Assign integer value based on customer email + date


Context: I have 2 columns of data: Col 1: date Col 2: customer email address

The same customer orders multiple times on different days

Problem: I want to understand how to assign based on date, and customer email address, whether it's their first time, second time etc.

I have not figure it out and looking for some help :)

Thanks a lot!

Example spreadsheet:

https://docs.google.com/spreadsheets/d/1LE7hO0ot22N1R-i35cDqG8OWDlZg2x1gE_kCHGdyruA/edit#gid=0


Solution

  • What I tried is to make a running count using COUNTIFS():

    enter image description here

    Formula in E2:

    =INDEX(IF(B2:B="","",COUNTIFS(C2:C,C2:C,B2:B,"<="&B2:B)))