IF Status = "" Subtract x days from Column

i have the following columns, “Install Date”, “Installer” “Depot”. im trying to make a formula where if Installer = “V” set formula date to (Installer Date - 1 Workday) IF Installer = “M” and Depot = DF OR DA OR WA OR WH, set formual date to (Installer Date - 5 Workdays)

i have tried the following but get a illegal formula error

IF({Installer} = “V”, DATE_SUB({Install date}, 1, “days”), IF(AND({Installer} = “M”, OR({Depot} = “DF”, {Depot} = “DA”, {Depot} = “WH”, {Depot} = “WA”)), DATE_SUB({Install date}, 5, “days”)))

Any help would be appreciated

Hi Connor,

Never heard of a DATE_SUB function…
Use ADD_DAYS({Install date},-1) instead.


Want to create formulas without using the formula column and cast their results to any type of columns instead? Take a look at the Advanced Formula Booster, the app that revolutionizes formulas in monday.com.

So ive managed to get it working with the below

IF({Installer} = ‘V’,
ADD_DAYS({Install date}, -1),
IF(AND(
{Installer} = ‘M’,
OR({Depot} = ‘DF’, {Depot} = ‘DA’, {Depot} = ‘WH’, {Depot} = ‘WA’)
),
ADD_DAYS({Install date}, -5),
ADD_DAYS({Install date}, -1)
)
)

its now returning the date in long form however, “THU jul 18, 2024, 00:00:00 GMT +0100”
id like this to be “Thu , 18 Jul” but how do i go about adding this? ive tried the below but isnt working. the other thing is i need the add_days to do it by weekdays. so the result from the formula can only be Monday to Friday

IF({Installer} = ‘V’,
FORMAT_DATE(ADD_DAYS({Install date}, -1), DD-MM),
IF(AND(
{Installer} = ‘M’,
OR({Depot} = ‘DF’, {Depot} = ‘DA’, {Depot} = ‘WH’, {Depot} = ‘WA’)
),
FORMAT_DATE(ADD_DAYS({Install date}, -5), DD-MM),
FORMAT_DATE(ADD_DAYS({Install date}, -1), DD-MM)
)
)