# IF, ELSE, OR in Formulas

Hi,

This is my current formula for an If not blank > do this OR if blank > do this:

``````IF({Discount}, {Brand} & " Discount Code: " & {Discount} &" off -",
IF(NOT(Discount), {Brand}))& " "&{Product Title}
``````

But I would like to add another option that if {column} contains “FREE TRIAL” or “FREE SAMPLE” to do the same as the first line but without the '“off -”. So far I have this:

``````IF({Discount}="FREE TRIAL",
{Brand} & " Discount Code: " & {Discount} &" - " & {Product Title},
{Brand} & " Discount Code: " & {Discount} &" off -" & {Product Title},
IF(NOT({Discount}, {Brand}& " "&{Product Title})))
``````

Thank you!

IF statements can have up to 3 arguments. Your first IF has 4 arguments:

1. {Discount}=“FREE TRIAL”
2. {Brand} & " Discount Code: " & {Discount} &" - " & {Product Title}
3. {Brand} & " Discount Code: " & {Discount} &" off -" & {Product Title}
4. IF(NOT({Discount}, {Brand}& " "&{Product Title}))

^ Also the closing parenthesis for the NOT() function is in the wrong spot.

Since all outputs start with `{Brand}` and end with `{Product Title}`, and both conditions for when Discount is not empty start with `" Discount Code: " & {Discount}` and end with `" - "`, I’m going to simplify your nested IF to the bare minimum.

``````{Brand} & " " & IF(
{Discount},
"Discount Code: " & {Discount} & IF({Discount} != "FREE TRIAL", " off") &  " - "
) & {Product Title}
``````
2 Likes

Thanks Kamille, this is great!

I also need to apply the same rule for "FREE TRIAL for “FREE SAMPLE”, how might I add that to the mix, please?

Thank you!

replace `{Discount} != "FREE TRIAL"` with

``````AND({Discount} != "FREE TRIAL", {Discount} != "FREE SAMPLE")
``````

This topic was solved and automatically closed 3 days after the last reply. New replies are no longer allowed.