I have two dated in my data.
Lets say,
30/09/2023 and 30/11/2023
I want to add a column for Period and mark the most recent one as "Current and the older one as "Previous".
Dates will keep changing and the difference in months or years may vary too so I can not use the if formula.
IS there any way i can do this?
You can use the following formula to add a column for Period and mark the most recent date as “Current” and the older one as “Previous”:
IF [Date1] > [Date2] THEN "Current" ELSE "Previous" ENDIF
Replace [Date1] and [Date2] with the names of the columns that contain your dates. This formula will compare the two dates and return “Current” if the first date is more recent than the second date, and “Previous” otherwise.
If you have more than two dates and want to mark the most recent date as “Current” and the rest as “Previous”, you can use the following formula:
IF [Date] = MAX([Date]) THEN "Current" ELSE "Previous" ENDIF
Replace [Date] with the name of the column that contains your dates. This formula will compare each date to the maximum date in the column and return “Current” if it matches, and “Previous” otherwise.
I hope this helps!
Both my dates are in the same column. Any alternative for that?
I will only have two dates in this column. So i just need to have the latest one as current and other one as previous. i can not really mention via record id here as the data is very comprehensive. It has multiple lines of current and previous date.