0

A project I am working on has me stumped. My question is I would like to put this data into a pivot table that I can sort by state in order to show the total number of each response response (a,b,c,ab,ac,bc) option to each question for the distinct states? Thanks.

State   Zip Code    Question 1  Question 2  Question 3
AL          35051   bc          b           c
AL          36853   b           ac          b
AL          35403   a           b           a
AK          99780   b           c           c
AK          99509   a           c           a
AK          99504   a           a           c

1 Answers1

1

You can do this easily if you normalize your data. Then it's just a matter of counting answers. This picture should explain:

enter image description here

Short of that, pnuts solution is the best.

If you want a way to normalize, I've got code at https://stackoverflow.com/a/10922351/293078. If that's too much, there's other more automated solutions out there, like http://tduhameau.wordpress.com/2012/09/24/the-unpivot-add-in/.

And here's a video of a different method from Contextures: https://www.youtube.com/watch?v=xmqTN0X-AgY.

Community
  • 1
  • 1
Doug Glancy
  • 27,214
  • 6
  • 67
  • 115