Forum Discussion
O_edwardsKPPB-9
Feb 07, 2023Copper Contributor
Formula for if a date is more than X days in the past
Can someone help me with a formula for Excel? If Column A returns a set of dates, is there a function to show if the dates in Column A are more than 30, 60, 120 days in the past?
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)
- mathetesSilver Contributor
- O_edwardsKPPB-9Copper Contributor
mathetes That is giving me an error and does not work 😕
- mtarlerSilver 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)