包含多列计数的表格?

huangapple go评论46阅读模式
英文:

Table containing the count of multiple columns?

问题

我有以下的表格:

问题 1 问题 2 问题 3
a a b
b a c
a c e
c b e
a d a

我如何创建一个数据透视表(或类似的东西),其中包含每个问题的答案计数?
即类似以下的结果:

问题 1 计数 问题 2 计数 问题 3 计数
a 3 2 1
b 1 1 1
c 1 1 1
d 0 1 0
e 0 0 2
英文:

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.

答案1

得分: 0

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

问题 1 问题 2 问题 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")

不是最美观的解决方案,但目前可行。不过,我会欣然接受更好的建议。

英文:

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.

huangapple
  • 本文由 发表于 2023年5月18日 06:44:43
  • 转载请务必保留本文链接:https://go.coder-hub.com/76276650.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定