Help

Nested if statements

Topic Labels: Formulas
809 1
cancel
Showing results for 
Search instead for 
Did you mean: 
Madalina_Belciu
4 - Data Explorer
4 - Data Explorer

Hi!

I am working on a content management dashboard. I have a single choice field with multiple types of assets, and I have an expiration date field with expiration dates for each asset. I want to create a formula field named Needs Review, that would return different values. For example:

If asset type is blog or newsletter, then Needs Review field should show Yes when expiration date is within 60 days. If expiration date is later than 60 days from today it should show No.
If asset type is video or webinar, then Needs Review field should show Yes when expiration date is within 90 days. If expiration date is later than 90 days from today it should show No.
And so on with a few other types of assets.

I also want to add some emojis for the answers in the Needs Review field.

I tried writing the formula using IF, AND and DATETIME_DIFF() but I can’t find a way to format it correctly. Do you have some advise on what’s the best way to write this formula?

Thank you!

1 Reply 1
Zack_S
8 - Airtable Astronomer
8 - Airtable Astronomer

Hi @Madalina.Belciu,

Sometimes it’s easier to break things down into an extra field or two.
image

I would setup an extra field called something like ‘review range’ that holds your 60 and 90 days intervals and use a SWITCH formula. See below.

SWITCH(Status, 
"Blog", 60, 
"Newsletter", 60,
"Video", 90
)

Then your ‘Needs Review’ field can contain the following formula.

IF(DATETIME_DIFF({Due Date}, TODAY(), 'days')<={Review Range (days)}, "✅ Yes", "⛔ No")

Hopefully, this is what you are looking for.