libreofficeopenoffice.orglibreoffice-calcopenoffice-calc

Table containing the count of multiple columns?


I've got the following table:

Question 1 Question 2 Question 3
a a b
b a c
a c e
c b e
a d a

How do I create a pivot table (or something similar) containing the count of answers per question? i.e. something like the following:

Value Question 1 Count Question 2 Count Question 3 Count
a 3 2 1
b 1 1 1
c 1 1 1
d 0 1 0
e 0 0 2

Creating it with one Column is easy enough, however I can't figure out how to do it with multiple columns because libreoffice will start stacking the rows/columns.

I'd appreciate any help or nudge in the right direction.

I tried creating a pivot table containing multiple rows/columns. I've already tried it by selecting my questions and putting them all in row or column, however libreoffice will start stacking them, creating subcolumns/rows without the correct result.


Solution

  • I've created a makeshift solution. It's basically the following somewhere else in the sheet:

    Value Question 1 Question 2 Question 3
    a =COUNTIF(A$2:A$122;"a") =COUNTIF(B$2:B$122;"a") =COUNTIF(C$2:C$122;"a")
    b =COUNTIF(A$2:A$122;"b") =COUNTIF(B$2:B$122;"b") =COUNTIF(C$2:C$122;"b")
    c =COUNTIF(A$2:A$122;"c") =COUNTIF(B$2:B$122;"c") =COUNTIF(C$2:C$122;"c")

    not the most beautiful solution but it works for now. I'd appreciate a better one though.