计算列中的百分比
我有一个 Excel 工作表,其中的信息格式类似于测试:
Choice Chosen Percentage
A
B
C
D
TOTAL
False
True
TOTAL
“选择”列给出了每个选项被选择的次数,以及相应问题的“总行总数”。我需要一种方法来快速找到每个被选择的百分比(选择/总计),但我不知道如何去做。
I have an Excel worksheet with information in a format much like a test:
Choice Chosen Percentage
A
B
C
D
TOTAL
False
True
TOTAL
The Chosen column gives how many times each choice was selected, and the Total row totals for the corresponding question. I need a way to quickly find the Percentage each was selected (Chosen/Total) but I am not sure how to go about it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为你不需要 VBA。如果我理解这个问题,这只是一个简单的公式。假设这些是标题,并且从单元格 A1 开始,则 b 列(选择为 A)的百分比将类似于 =B2/$F2,并将该列格式化为百分比类型。
请注意,$F 是对 F 的绝对引用,因此当您向下填充时,它始终指向 F 行(总行),但列号会按其应有的方式更改。
I don't think you need VBA for that. It's just a simple formula if I understand the question. Assuming these are headers and it starts at cell A1, then Percentage for column b (choice was A) will be like =B2/$F2 and you format the column as percentage type.
Note the $F is an absolute reference to F so that when you fill down, it always points to row F (total row) but the column number changes as it should.
我正在这个窗口中即时编写代码,因此您需要注意错误。另外,您需要输入伪代码的代码,
我使用 frs 来表示“firstrow”已设置
I am writing code on the fly and in this window itself, so you'd need to watch out for errors. Also, you'll need to put in code for psuedo code
I am using frs to signify 'firstrow' has been set