Search code examples
excelexcel-formulasequencecountif

How to create a Sequence number based on Sales Agent name and sale date in excel using formula


I am looking for a formula which can write the sequence no based on the criteria of Salesperson name and Sale order Date. below is the sample table. Please check if anyone can help me.

enter image description here

I tried using countif

=COUNTIFS(C$2:C2,"<="&C2,A$2:A2,A2)

but not getting the expected results as given in the image


Solution

  • This formula gives this result

    =MATCH(B2,SORT(TOCOL(IF(A$2:A$8=A2,B$2:B$8,1/0),3),1,1),0)

    enter image description here