Help

Save the date! Join us on October 16 for our Product Ops launch event. Register here.

IF or SWITCH statement to return different formula based on single select status

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

Hello! getting lost in the sauce of nested IF formulas and looking for help.

I have a CRM in airtable that I'd like for a formula to return one of two formulas based on a single select status for that deal.

If the deal is open (any one of 7/10 statuses in the single select), I'd like for it to show the deals age based on today's date

 

 

DATETIME_DIFF( TODAY(),{Deal Created}, 'weeks')

 

 

If the deal is closed (any of 3/10 statuses in the single select) I'd like for it to show the age of the deal when it was closed:

 

 

DATETIME_DIFF({Date Closed or Lost},{Deal Created}, 'weeks')

 

 

Thanks for your help!

1 Reply 1

Could you give this a shot?

IF(
  OR(
    {Status} = "Closed/Lost Option 1",
    {Status} = "Closed/Lost Option 2",
    {Status} = "Closed/Lost Option 3"
  ),
  DATETIME_DIFF({Date Closed or Lost},{Deal Created}, 'weeks'),
  DATETIME_DIFF( TODAY(),{Deal Created}, 'weeks')
)