需要 Excel 宏的帮助来组织混乱的调查
我一直在尝试编写一个宏(分步骤)来组织设计非常糟糕的调查的结果,但我运气不佳。
这是我所拥有的示例:
这是我需要的示例:
我遇到了几个问题,其中之一是调查中的 15 个问题并非全部都需要回答,这使得循环遍历结果时尚难顺利。
一个更大的问题(与上一期相关)是,调查中的 15 个问题中有 3 个是“选择所有适用的”类型的问题,并且每个选择都记录为单独的答案,但编号相同。例如,问题 10 有 11 种可能的选择,用户可以根据需要选择任意数量的选项。如果他们选择问题 10 的第 1 个和第 3 个选项,结果将类似于我的我拥有的
示例的第 3 行和第 4 行。
我的我需要什么
示例显示,我需要列中的所有问题和各自行中的所有受访者编号,以及受访者在各自编号下的长答案。
最终产品中不需要 What I have
示例中的 ID
列,但我暂时将其保留在结果中,认为它可能会以某种方式帮助解决这个混乱问题。
我想知道我是否应该回到给我这个的人并告诉他们我很抱歉,但我对此无能为力,因为它太混乱了。如果您认为可以修复这些调查结果,请给我一些指示(请详细说明,我对 VB 脚本没有太多经验)。
也欢迎任何其他评论、想法或建议。
I have been trying to write a macro (in steps) to organize the results of a very poorly designed survey, but I am having very little luck.
Here is a sample of what I have:
Here is a sample of what I need:
I am running into several problems, one of which is that not all of the 15 questions on the survey had to be answered which makes looping through the results in a smooth fashion difficult.
An even bigger problem (tied to the previous issue) is that 3 of the 15 questions on the survey were "Select All That Apply" type questions, and every selection was recorded as a separate answer, but with the same number. For example question 10 had 11 possible selections which a user could choose as many or as few of as they wanted. If they selected the 1st and 3th options of question 10 the result would look like rows 3 and 4 of my What I have
sample.
My What I need
sample shows that I need all the questions in columns and all the respondent numbers in their own row, with the long answers from a respondent under their respective number.
The ID
column from the What I have
sample is not needed in the final product, but I have left it in the results for now thinking it might somehow help sort this mess out.
I am wondering if I should just go back to the person who gave this to me and tell them I'm sorry but I cannot do anything with this since it is so messed up. If you think it is possible to fix these survey results please give me some pointers (be detailed, I don't have much experience with VB Script).
Any other comments, thoughts, or suggestions are also welcome.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我在 Excel 以及 Access 2003 和 2010 中拥有多年使用 VBA 的经验,我可以告诉您,在 Excel 中处理这不会很有趣;根据调查结果的结构,我强烈建议将其导入 Access(如果有)并运行 SQL 查询来对数据进行切片和切块。它实际上是数据库表的格式,甚至有一个主键(ID)。
I have years of experience with VBA in Excel and Access 2003 and 2010, and I can tell you this would not be fun to process in Excel; based on the structure of the survey results, I would highly recommend importing this into Access (if you have it) and running SQL queries to slice and dice the data. It's really in the format of a database table, it even has a primary key (ID).
我会将其导入数据库,然后使用一两个简单的查询来生成您想要的内容。
I would import that into a database then use a simple query or two to generate what you want.
这是 Excel VBA 的开始,在 Access 中这是一个非常简单的查询。
这是基于在sheet2上有一个表,如下所示:
Here is a start in Excel VBA, in Access this is quite a simple query.
This is based on having a table on sheet2, like so: