# Find All Rows With Same Date And Input A Value In Another Cell

So this one is a bit complicated (I think) and might need to be done through VBA. I need to do the following:

1. Find all of a earliest date in Column A

2. Enter the same number in Column B for each row found

3. Find all of the next earliest date in Column A

4. Enter the next sequential number from the one entered previously in Column B for each new row found

5. Repeat until through the latest date in Column A

I am hoping I can make relatively quick work of this, at least compared to updating each of the 5,000 plus row manually!

Thanks in advance for any and all help!

=LET(rng,A1:A5000,

stacked,HSTACK(SORT(UNIQUE(rng)),SEQUENCE(COUNT(SORT(UNIQUE(rng))))),

BYROW(rng,LAMBDA(r,XLOOKUP(r,CHOOSECOLS(stacked,1),CHOOSECOLS(stacked,2)))))

Alternatively this formula returns the intended result in my Excel for the web sheet.