Renaming Values In Another Column For Grouping

jkancler

New Member
Joined
May 21, 2014
Messages
8
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?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
First one looks like a syntax error, missing lots of parenthesis. Second one, looks like you are missing quotes around all your (left) strings.
 
Upvote 0
First one looks like a syntax error, missing lots of parenthesis. Second one, looks like you are missing quotes around all your (left) strings.

Yes that did the trick! That's twice you saved me in the past few days Scottsen. Thank you very much :)
 
Upvote 0

Forum statistics

Threads
1,223,996
Messages
6,175,864
Members
452,678
Latest member
will_simmo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top