Hi AppSheet community,
I’m trying to create a formula that, given a date, returns the same day in the next month with the following considerations:
• For example, if today is July 15, it should return August 15.
• If the same day does not exist in the next month (like January 31 → February 28 or 29), it should return the last day of that next month.
• If the date is in December, it should return the same day but in the next year (e.g., December 31 → January 31 next year).
I spent huge time but I couldn't figure it out. could someone help mo te create this function correctly
Thanks in advance!
Solved! Go to Solution.
Please try
IF(DAY(TODAY())=31, EOMONTH(TODAY(),1),
EOMONTH(TODAY(), 0) +DAY(TODAY())
)
Please test well.
Please try
IF(DAY(TODAY())=31, EOMONTH(TODAY(),1),
EOMONTH(TODAY(), 0) +DAY(TODAY())
)
Please test well.
It's returning this error:
EOMONTH() requires 2 arguments, received 1
I have modified one typo error. Could you retest please?
Update: It worked for all dates except 12/31/2024
Could you update what results you are getting for 12/31/2024
oh sorry for this, it's working properly. thank you so much for your help
You are welcome.
However, I believe it still needs more logic because it will roll up to 01 March for today's date of 29, 30 January in a non leap year and will roll up to 01 March for today's date of 30th January in a leap year. Could you test it?
We could fix it, if it is very essential that it rolls up to 28 or 29th February for input dates of January 29 and 30
However naturally, the expression will become longish.
Yes, I tested and we have this issue. It would be perfect if we could fix this. thank you so much for your help again. btw I am using [Due Date] instead of Today() (it's a date column on my table)
Please try
IFS(
IN(TEXT([Due Date], "MMDD"), LIST( "0130", "0129")) , EOMONTH([Due Date],1),
DAY([Due Date])=31, EOMONTH([Due Date],1),
TRUE, EOMONTH([Due Date], 0) +DAY([Due Date])
)
User | Count |
---|---|
18 | |
11 | |
11 | |
8 | |
4 |