Is it possible to separate multiple answers in one column and make it into a bar graph?

Maya2022

New Member
Joined
May 18, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello everyone! This is my first post so I'm sorry if I've made a mistake:

I'm trying to create some bar/line/pie charts within Excel using data from a survey. However, one of the questions that was imported over has multiple answers within the same category (see column E in fake sample photo). Is there an easy way to create a bar graph that shows the popularity of each answer within that answer? Or, alternatively, is there an easy way to recategorize the data in column E to separate each answer? My actual spreadsheet has too many responses to do easily one by one.

Screenshot 2022-05-18 103323.png
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
No pineapple.

MrExcelPlayground8-1.xlsx
ABCDEFGHIJK
1NameAgeDatePizza?ToppingsFav?Split
2john121/1/2022yesCheese, Pepperoni, SausageCheeseCheesePepperoniSausage
3jane212/2/2022noCheese, Bacon, Olives, Spinach, ChickenBaconCheeseBaconOlivesSpinachChicken
4Jamie491/1/2021YesGarlic, PepperoniGarlicGarlicPepperoni
5Nicole214/5/2019yesBrocoli, SpinachSpinachBrocoliSpinach
6
7
8
9All ItemsCount of people that like it
10Cheese2
11Pepperoni2
12Sausage1
13Bacon1
14Olives1
15Spinach2
16Chicken1
17Garlic1
18Brocoli1
Sheet31
Cell Formulas
RangeFormula
G2:I2,G4:H5,G3:K3G2=TRANSPOSE(FILTERXML("<x><y>"&SUBSTITUTE(E2,", ","</y><y>")&"</y></x>","//y"))
E10:E18E10=UNIQUE(FILTERXML("<x><y>"&SUBSTITUTE(TEXTJOIN(", ",TRUE,E2:E5),", ","</y><y>")&"</y></x>","//y"))
F10:F18F10=SUM(IF(ISERROR(SEARCH(E10,$E$2:$E$5)),0,1))
Dynamic array formulas.


Text Join might get problematic if the list gets really long (32000 characters). But if you have a complete list of possible toppings, you can skip the formula in E10.
Pie charts are most appropriate.
 
Last edited:
Upvote 0
Solution
No pineapple.

MrExcelPlayground8-1.xlsx
ABCDEFGHIJK
1NameAgeDatePizza?ToppingsFav?Split
2john121/1/2022yesCheese, Pepperoni, SausageCheeseCheesePepperoniSausage
3jane212/2/2022noCheese, Bacon, Olives, Spinach, ChickenBaconCheeseBaconOlivesSpinachChicken
4Jamie491/1/2021YesGarlic, PepperoniGarlicGarlicPepperoni
5Nicole214/5/2019yesBrocoli, SpinachSpinachBrocoliSpinach
6
7
8
9All ItemsCount of people that like it
10Cheese2
11Pepperoni2
12Sausage1
13Bacon1
14Olives1
15Spinach2
16Chicken1
17Garlic1
18Brocoli1
Sheet31
Cell Formulas
RangeFormula
G2:I2,G4:H5,G3:K3G2=TRANSPOSE(FILTERXML("<x><y>"&SUBSTITUTE(E2,", ","</y><y>")&"</y></x>","//y"))
E10:E18E10=UNIQUE(FILTERXML("<x><y>"&SUBSTITUTE(TEXTJOIN(", ",TRUE,E2:E5),", ","</y><y>")&"</y></x>","//y"))
F10:F18F10=SUM(IF(ISERROR(SEARCH(E10,$E$2:$E$5)),0,1))
Dynamic array formulas.


Text Join might get problematic if the list gets really long (32000 characters). But if you have a complete list of possible toppings, you can skip the formula in E10.
Pie charts are most appropriate.
I'm quite partial to pineapple on pizza myself, but I think that is an argument for somewhere else haha. Thank you so much for taking the time to show me this! It really made things 10x easier.
 
Upvote 0
There is a new function "TEXTSPLIT" and others coming to excel365 soon. It will handle these things more elegantly.
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,194
Members
449,072
Latest member
DW Draft

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