Aug 19, 2022 03:45 AM
Hi people!
I’m building a “Birthdays” table in my “Calendar” base and I’m looking for a formula that says:
if “Birthday” is within the next 2 months then display “soon”
What would this formula look like?
Solved! Go to Solution.
Aug 21, 2022 06:01 AM
Sorry! More complicated than I first realised. Try this:
IF(AND(SUM(DATETIME_FORMAT(TODAY(), "M")-DATETIME_FORMAT({Birthday}, "M"))<=2, SUM(DATETIME_FORMAT(TODAY(), "M")-DATETIME_FORMAT({Birthday}, "M"))>-1), "Soon")
This should work for any date given in {Birthday}, regardless of year.
Aug 20, 2022 10:39 AM
IF(DATETIME_DIFF(TODAY(), {Birthday}, "months")<=2, "Soon")
Aug 21, 2022 03:23 AM
Thanks Jonathan!
I’m still having a problem here. No errors from the formula but the formula labels ALL of the records as “Soon” in the formula field regardless of date.
Aug 21, 2022 06:01 AM
Sorry! More complicated than I first realised. Try this:
IF(AND(SUM(DATETIME_FORMAT(TODAY(), "M")-DATETIME_FORMAT({Birthday}, "M"))<=2, SUM(DATETIME_FORMAT(TODAY(), "M")-DATETIME_FORMAT({Birthday}, "M"))>-1), "Soon")
This should work for any date given in {Birthday}, regardless of year.
Aug 22, 2022 08:05 AM
It works! but I have to filter out next years birthdays or it goes a bit haywire and can’t be filtered using the “Soon” field once the formula is used.