Skip to main content

Hello,


I am trying to create a formula to return the category of my campaign based on the campaign name. For example, if my campaign is “Carlie Bookcase-Manual-Walmart” I want it to return “Bookcases”. I looked into nested IF formulas and FIND formulas and tried to combine them.


I got it to work for 1 category using this:

IF((FIND(“Desk”,{Campaign Name})),“Desk - Vanity”)


But if I try to add more criteria for other categories my formula is invalid. Here is the invalid formula:

IF(

(FIND(“Desk”,{Campaign Name})),

"Desk - Vanity”,

IF(

(FIND("Dining”,{Campaign Name})),

"Dining Tables”,

)

)

Hi Laurie. You use one more set of parens than I would but the only other issue I see may be the type of double quotes you use. I see two different types. Change them all to " or even single quotes '.


Hi Laurie. You use one more set of parens than I would but the only other issue I see may be the type of double quotes you use. I see two different types. Change them all to " or even single quotes '.


The styled quotes are most likely due to the fact that the formula wasn’t formatted as plain text (tip for @Laurie_Tovo: use the </> button on the toolbar to create this styling, which makes formulas easier to read and safer to copy/paste). I ran a test with the extra parentheses, and they don’t cause a problem. What I didn’t catch until I tried this formula myself is the trailing comma after “Dining Tables”. Take it out and it’ll work. (And remove the extra parentheses around the FIND() functions while you’re in there. 🙂 )


IF(
FIND("Desk", {Campaign Name}),
"Desk - Vanity",
IF(
FIND("Dining", {Campaign Name}),
"Dining Tables"
)
)

The styled quotes are most likely due to the fact that the formula wasn’t formatted as plain text (tip for @Laurie_Tovo: use the </> button on the toolbar to create this styling, which makes formulas easier to read and safer to copy/paste). I ran a test with the extra parentheses, and they don’t cause a problem. What I didn’t catch until I tried this formula myself is the trailing comma after “Dining Tables”. Take it out and it’ll work. (And remove the extra parentheses around the FIND() functions while you’re in there. 🙂 )


IF(
FIND("Desk", {Campaign Name}),
"Desk - Vanity",
IF(
FIND("Dining", {Campaign Name}),
"Dining Tables"
)
)

It works! Thank you so much for your help, this is very helpful


Reply