简体   繁体   English

在单个单元格中收集逗号分隔的数据

[英]Collecting comma separated data in a single cell

I have an excel table which stores results from a questionnaire. 我有一个excel表,用于存储问卷调查的结果。 It includes a column where the responder includes multiple responses. 它包括一列,其中响应者包括多个响应。 I want to treat each response as a separate data point: 我想将每个响应视为一个单独的数据点:

Favourite Colour | Age |
-------------------------
Blue, Black      | 12  |
Red, Green, Blue | 11  |
Orange           | 12  |
Black, Blue, Red | 13  |
Red, Black       | 11  |
...

Which would return: 哪个会返回:

Blue: 3
Black: 3
Red: 3
Green: 1
Orange: 1

Even better: 更好的是:

12 - Black: 1
   - Blue:  1
   - Orange:1
11 - Red:   2
   - Green: 1
...

And I would hopefully be able to put this in a graph. 我希望能够将其放在图表中。

I've done some reading online and come across a LookUp command or LookUpV but am not sure about them so I though I would post a question. 我已经完成一些在线阅读,遇到过LookUp命令或LookUpV但是不确定它们是否正确,因此尽管我会提出一个问题。

Hopefully I made my point clear enough. 希望我的观点足够清楚。

Assuming the table you give is in A1:B6 (with headers in row 1), and that you put eg "Blue" in D2, enter this formula in E2: 假设您提供的表在A1:B6中(标题在第1行中),并且您在D2中放置了例如“ Blue”,则在E2中输入以下公式:

=SUMPRODUCT(LEN($A$2:$A$6)-LEN(SUBSTITUTE($A$2:$A$6,D2,"")))/LEN(D2) = SUMPRODUCT(LEN($ A $ 2:$ A $ 6)-LEN(SUBSTITUTE($ A $ 2:$ A $ 6,D2,“”)))/ LEN(D2)

This can then be copied down to give similar results for colours in D3, D4, etc. 然后可以将其复制下来,以得到D3,D4等颜色的相似结果。

Regards 问候

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从单个单元格中提取由逗号分隔的数据 - Extract data separated by a comma from a single cell Excel:除以逗号分隔的单个单元格数字 - Excel: Dividing comma separated single cell numbers 以逗号分隔数据的单元格上的索引匹配 - INDEX MATCH on a cell that has data separated by a comma 动态查找单元格中的多个值(逗号分隔)并将相应的 ID 返回到单个单元格(逗号分隔) - Dynamic Lookup for multiple values in a cell (comma separated) and return the corresponding ID to a single cell (comma separated also) 在单个单元格中查找多个值(以逗号分隔),然后将值返回到单个单元格(也以逗号分隔) - Lookup multiple values in a single cell (separated by commas) and then return the values to a single cell (also comma separated) EXCEL:在单元格中乘以逗号分隔的个位数 - EXCEL: Multiplying comma separated single-digit numbers in a cell 使用Excel宏用逗号分隔单个单元格中的多行 - Multiple Lines in a single cell separated by a comma using Excel Macros 如何用逗号分隔的值将数千个列合并到单个单元格中 - How to combine thousands of columns into a single cell with comma separated values 如何从 excel 中的单个单元格计算逗号分隔的特定值 - How to count comma separated specific value from a single cell in excel 使用单个单元格的逗号分隔值作为数组公式的输入 - Use comma separated value of a single cell as input for array formula
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM