Forum Discussion
Formula for if a date is more than X days in the past
- Feb 08, 2023
another option:
=XLOOKUP(TODAY()-A1, {30,60,120}, {">30",">60",">120"}, "<30", -1)
as for Mathetes try:
=IFS(TODAY()-A1>=120,"120",TODAY()-A1>=60,"60",TODAY()-A1>=30,"30",1,"<30")one more option in case you have an old Excel version:
=VLOOKUP(TODAY()-A1,{-9999,"<30";30,">30";60,">60";120,">120"},2,1)
- O_edwardsKPPB-9Feb 08, 2023Copper Contributor
mathetes That is giving me an error and does not work 😕
- mtarlerFeb 08, 2023Silver Contributor
another option:
=XLOOKUP(TODAY()-A1, {30,60,120}, {">30",">60",">120"}, "<30", -1)
as for Mathetes try:
=IFS(TODAY()-A1>=120,"120",TODAY()-A1>=60,"60",TODAY()-A1>=30,"30",1,"<30")one more option in case you have an old Excel version:
=VLOOKUP(TODAY()-A1,{-9999,"<30";30,">30";60,">60";120,">120"},2,1)
- ALex1RoseMar 21, 2025Copper Contributor
This comes back with an error on my Microsoft 365, with Windows 11.
Even ChatGPT can't give a formula for something as simple as a todays date being close to an expiry date.
Either ChatGPT sucks, or 365 sucks.