Help

Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

Multiple IF statements in a formula

Topic Labels: Formulas
251 2
cancel
Showing results for 
Search instead for 
Did you mean: 

Could someone please help troubleshoot this?

I’m trying to calculate an expiration date based on the service provided. I believe I shouldn’t really be using “or” here, but included this just to help illustrate what I’m trying to do. Each IF statement works individually but not when I try to string them together.

I have about 10 of these conditions that I’d like to check for.

IF({Service}=‘Heartguard Plus’,(DATEADD({Date Expires},1,“Month”)))
or
IF({Service}=‘Annual Exam’,(DATEADD({Date Expires},1,“Year”)))
or
IF({Service}=‘3 year Rabies’,(DATEADD({Date Expires},3,“Year”)))

Thanks for your help!

2 Replies 2

I recommend you use a SWITCH instead.

SWITCH({Service}, 
  'Heartguard Plus', DATEADD({Date Expires},1,"Month"),
  'Annual Exam', DATEADD({Date Expires},1,"Year"),
  '3 year Rabies', DATEADD({Date Expires},3,"Year")
)

Oh that looks much easier! I’ll give that a shot, thanks!