I have values in a column that I'm unable to group in a pivot table. I'm trying to rename them in a new column to try and create the groupings - Brand, NonBrand, and PLA.
I've tried to create a new column using the Switch and Search functions below but keep getting the following error: The end of the input was reached. The calculated column contains a syntax error. Provide a valid formula.
First Attempt:
=IF(IFERROR(SEARCH("brand",[Campaign]),-1)<>-1, "Brand",
IF(IFERROR(SEARCH("brand-bargains",[Campaign]),-1)<>-1,"Brand",
IF(IFERROR(SEARCH("x1",[Campaign]),-1)<>-1,"PLA",
IF(IFERROR(SEARCH("branded",[Campaign]),-1)<>-1,"Brand",
IF(IFERROR(SEARCH("brand2",[Campaign]),-1)<>-1,"Brand",
IF(IFERROR(SEARCH("Trademark",[Campaign]),-1)<>-1,"Brand",
IF(IFERROR(SEARCH("Accessories",[Campaign]),-1)<>-1,"PLA",
IF(IFERROR(SEARCH("All Products",[Campaign]),-1)<>-1,"PLA",
IF(IFERROR(SEARCH("scents-general",[Campaign]),-1)<>-1,"NonBrand",
IF(IFERROR(SEARCH("",[Campaign]),-1)<>-1,"Unknown",
"Unknown"))
Attempt two:
=SWITCH([CAMPAIGN],
brand,"Brand",
brand-bargains,"Brand",
Candles,"PLA",
branded,"Brand",
brand-scents,"Brand",
Trademark ,"Brand",
Accessories,"PLA",
All Products,"PLA",
general,"NonBrand",
NB-Effective-kws,"NonBrand",
Category - x1,"NonBrand",
Category - x2,"NonBrand",
Trademark - Top Exact,"Brand",
Category - x3,"NonBrand",
brand-products,"Brand",
Category - x4,"NonBrand",
Category - x5,"NonBrand",
Category - x6,"NonBrand",
Category - x7,"NonBrand",
Category - Holiday,"NonBrand",
Category - x8,"NonBrand",
Category - x9,"NonBrand",
Trademark - Holiday,"Brand",
Trademark - x10,"Brand",
Category - x11,"NonBrand",
Category - x12,"NonBrand",
competitor,"NonBrand",
,"Uknown",
“New Campaign”
)
Any thoughts on what I'm doing wrong?
I've tried to create a new column using the Switch and Search functions below but keep getting the following error: The end of the input was reached. The calculated column contains a syntax error. Provide a valid formula.
First Attempt:
=IF(IFERROR(SEARCH("brand",[Campaign]),-1)<>-1, "Brand",
IF(IFERROR(SEARCH("brand-bargains",[Campaign]),-1)<>-1,"Brand",
IF(IFERROR(SEARCH("x1",[Campaign]),-1)<>-1,"PLA",
IF(IFERROR(SEARCH("branded",[Campaign]),-1)<>-1,"Brand",
IF(IFERROR(SEARCH("brand2",[Campaign]),-1)<>-1,"Brand",
IF(IFERROR(SEARCH("Trademark",[Campaign]),-1)<>-1,"Brand",
IF(IFERROR(SEARCH("Accessories",[Campaign]),-1)<>-1,"PLA",
IF(IFERROR(SEARCH("All Products",[Campaign]),-1)<>-1,"PLA",
IF(IFERROR(SEARCH("scents-general",[Campaign]),-1)<>-1,"NonBrand",
IF(IFERROR(SEARCH("",[Campaign]),-1)<>-1,"Unknown",
"Unknown"))
Attempt two:
=SWITCH([CAMPAIGN],
brand,"Brand",
brand-bargains,"Brand",
Candles,"PLA",
branded,"Brand",
brand-scents,"Brand",
Trademark ,"Brand",
Accessories,"PLA",
All Products,"PLA",
general,"NonBrand",
NB-Effective-kws,"NonBrand",
Category - x1,"NonBrand",
Category - x2,"NonBrand",
Trademark - Top Exact,"Brand",
Category - x3,"NonBrand",
brand-products,"Brand",
Category - x4,"NonBrand",
Category - x5,"NonBrand",
Category - x6,"NonBrand",
Category - x7,"NonBrand",
Category - Holiday,"NonBrand",
Category - x8,"NonBrand",
Category - x9,"NonBrand",
Trademark - Holiday,"Brand",
Trademark - x10,"Brand",
Category - x11,"NonBrand",
Category - x12,"NonBrand",
competitor,"NonBrand",
,"Uknown",
“New Campaign”
)
Any thoughts on what I'm doing wrong?