How to use the Switch formula for greater than, lesser than criteria?

Hi,

I’m trying to get familiar with the SWITCH formula by taking a shot at using it instead of a nested IF but can’t seem to figure out the following.

I have a field called “Expiry Date” (type Date) and another field called “Expired?”, which is a formula field where I’m trying to use the SWITCH formula. My goal is that the “Expired?” field formula should output “Expired” if the “Expiry Date” is lesser than TODAY(); it should output “Expires today” if the “Expiry Date” equal to TODAY(); and should output “Still Active” if the "Expiry Date is greater than TODAY().

The formula I’m using is

SWITCH({Expiry Date},<TODAY(),"Expired",=TODAY(),"Expires Today", >TODAY()"Still Active","N/A")

I’m definitely doing something wrong because I’m getting a formula error.

Can somebody please help me with this.

Thanks,
Sean

You’ll need to use a nested IF formula, because that’s not how the SWITCH function works. The SWITCH function only allows one expression, and then you list a static set of results to choose from.

4 Likes

Ah, got it. Thanks, Scott. Appreciate it.

1 Like

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.