Embedded IF Function

Hi everybody,

I am reaching out beacuse I am trying do use an embedded If Fucntion based on a Status (Annual, Quarter, In-Fill).

Depending on the Status I want to calculate when the next invoice is required by adding days to the last invoice.
Somehow my formula works for the “Annual” part of the If fucntion but when setting the status as “Quarter” or " In-Full" I receive the “true result”

I would appreciate any help possible.

this is the formula:
IF({Invoice Cycle}=“Annual”, FORMAT_DATE(ADD_DAYS({Last Invoice},363,
IF({Invoice Cycle}=“Quarter”,FORMAT_DATE(ADD_DAYS({Last Invoice},88,
IF({Invoice Cycle}=“In-Full”, “Never”,0)))))))

I have also tried to integrate If(Search( without any luck so far.

I am looking forward to eharing back.

Thanks
Max

Hi @MaxW - possibly a SWITCH statement would work better?

SWITCH({Invoice Cycle},
“Annual”, FORMAT_DATE(ADD_DAYS({Last Invoice},363)),
“Quarter”, FORMAT_DATE(ADD_DAYS({Last Invoice},88)),
“In-Full”, “Never”, “”)

Hope this helps!
Mark

Hi mark,

Thankks for the help. Unfortunately this did not work and I now get a “!” error.
Any additional help is appreciated.

Hi @MaxW - copy & paste messes up the quotations. Try copying the following below and just double check afterwards that is looks the same as it works in my environment.

SWITCH({Invoice Cycle},
"Annual", FORMAT_DATE(ADD_DAYS({Last Invoice},363)),
"Quarter", FORMAT_DATE(ADD_DAYS({Last Invoice},88)),
"In-Full", "Never", 
"")

it worked. Thanks a lot!!!

1 Like