I am looking for some guidance in looping through a function in Excel within a table without running into a circular reference error. I've spent quite some time trying out COUNTIF, MATCH, Essentially, I need to create a function/formula for the "Desired Date" column so that it takes value from the "Original Date" column and changes the value based on the following parameter:
If a date in the Original Date column does not exist within the previous values of the Desired Date column, it will list the exact date. I've already solved this part with IF and COUNTIF functions.
If a date in the Original Date column already exits within the previous values of the "Desired Date" column, it will add +1 day(s) until all the values within the Desired Date column have unique dates.
Here's what I would like the function to do:
Row 1 contains the original date value as 8/1, since no other values exist in the desired row column, it will return 8/1.
Row 2 contains the original date value as 8/1, but since row 1 of the desired date value already contains value 8/1, it will add +1 day so it becomes 8/2.
Row 3 contains the original date value as 8/1, but since row 1 & row 2 of the desired date contain the value, it will add +2 days, so it becomes 8/3.
Row 6 contains the original date value as 8/3, but since row 3 of the desired date contain the value, it will add +1 day so it becomes 8/4.
If at any given point a date within the original date changes, the values in desired dates should change accordingly by adding a variable amount of days until all values within the Desired Dates column are unique.
| Row | Original Dates | Desired Dates |
|---|---|---|
| 1 | 8/1/2021 | 8/1/2021 |
| 2 | 8/1/2021 | 8/2/2021 |
| 3 | 8/1/2021 | 8/3/2021 |
| 4 | 8/12/2021 | 8/12/2021 |
| 5 | 8/12/2021 | 8/13/2021 |
| 6 | 8/3/2021 | 8/4/2021 |
| 7 | 8/4/2021 | 8/5/2021 |
| 8 | 8/3/2021 | 8/6/2021 |
| 9 | 8/13/2021 | 8/14/2021 |
I've spent well over 9 hours on this issue so any help at this point would be very much appreciated. I wouldn't mind using VBA but a function would be preferred for compatibility purposes.
Thank You!

