Virtual Column_Valid, Expired,Expiring

Hi everyone
I ask myself how to do this and if it is the best solution. In a virtual column I would like you to insert a value based on the course deadline.
Example of column "Expiring Date" if the value of the date is equal to that of the current day "expired" value, if expiring 3 months before "Expired" if valid "Valid"
I'll give an example with today's date
Course expiry date 04/05/2025="Valid"
Course expiry date 05/01/2024="Expiring"
Course expiry date 05/04/2024="Expired"

I hope I explained myself, thanks

0 2 74
2 REPLIES 2

Hello man, I need to know what result comes from this, you said you want a valid_if, but it prevents the user to enter an invalid data based on a paramenter. In this caso the parameter seems to be the date. Right? 
What column will receive the Valid-If parameter? 
You need to create a virtual column with an expression like this:

IFS(
TODAY() > [Course expiry date], "Expired"
,
TOTALHOURS([Course expiry date]-TODAY())/24 <30, "Expiring"
,
TOTALHOURS([Course expiry date]-TODAY())/24 >30, "Valid"
)

I might have not understood what you want, but this is the ogic you're looking for to achieve that result.

Hi you're a genius it works great!!

Thanks a lot!!

Top Labels in this Space