Mar 20, 2023 08:45 AM - edited Mar 20, 2023 08:51 AM
I am trying to create a payment due date based on adding days (either 15 or 30) depending on what kind of vendor type is selected. Both 'if' parts of the formula work if I place them in separate formula fields but I would like this to all come through on the same column so I can see 'payment due date' in one place - anyone able to help?
IF({Vendor Type (from Vendor) 2}=“Independent Contractor”,
DATEADD(Created,3,‘days’),IF(
{Vendor Type (from Vendor) 2}=“Included in Payroll/TEAMs”,
DATEADD(Created,5,‘days’))
Mar 20, 2023 08:58 AM
Hey @imomarsx,
You just needed to tweak your parentheses and sequencing a bit, but overall a pretty easy fix.
Try this:
IF(
{Vendor Type (from Vendor) 2} = "Independent Contractor",
DATEADD(
{Created}, 3 , "days"
),
IF(
{Vendor Type (from Vendor) 2} = "Included in Payroll/TEAMs",
DATEADD(
{Created}, 5, "days"
)
)
)
Mar 20, 2023 09:05 AM
This is a huge help thank you!! And if I want the first option to be either "Independent Contractor" or "Company" what would the best syntax be here? Apologies for the probably stupid question.
Mar 20, 2023 09:11 AM
Nah, not stupid at all!
You can accomplish this by implementing the OR() function, specifically:
OR(
{Vendor Type (from Vendor) 2} = "Independent Contractor",
{Vendor Type (from Vendor) 2} = "Company"
)
Here's the full formula:
IF(
OR(
{Vendor Type (from Vendor) 2} = "Independent Contractor",
{Vendor Type (from Vendor) 2} = "Company"
),
DATEADD(
{Created}, 3 , "days"
),
IF(
{Vendor Type (from Vendor) 2} = "Included in Payroll/TEAMs",
DATEADD(
{Created}, 5, "days"
)
)
)