将 Excel 中的频率表扩展为单列
我在 Stack Overflow 上的其他地方读到 Excel 问题在这里是可以接受的,所以请不要生气:)如果它们应该在其他地方,请告诉我......
我很沮丧,因为我很确定我使用了知道如何做到这一点。
想象一下下表:
Frequency Object
3 A
2 B
4 C
在第三列中,我希望 Excel 写入:
A
A
A
B
B
C
C
C
C
(3 A,因为 A 的频率 = 3)
我很确定这可以通过复制到第三列的单个公式来完成,但我可以'不记得怎么了。有什么建议吗?
I've read elsewhere on Stack Overflow that Excel questions are acceptable here, so please don't get annoyed :) If they should be elsewhere, just let me know...
I'm frustrated, because I'm pretty sure I used to know how to do this.
Imagine the following table:
Frequency Object
3 A
2 B
4 C
In a third column, I want Excel to write:
A
A
A
B
B
C
C
C
C
(3 A's because frequency of A = 3)
I'm pretty sure that this can be done by a single formula copied down the third column, but I can't remember how. Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我喜欢(1)公式的优雅,但它只有在没有重复的对象(数据)时才有效。
只要 E2 中没有非零的数字值,这将始终有效
E3:E6
中的频率值和D3:D6
中的 Obj,从 P3 开始的公式或(在这种情况下,E2 中可以有任何内容)
Ctrl在P3中+Shift+Enter并复制
CR
I liked the elegance of (1) formula, but it will only work if you dont have repeated objects (data).
This will always work, as long you dont have a numeric, diferent from zero, value in E2
Freq values in
E3:E6
and Obj inD3:D6
, formula starting in P3or (and, in this case, you can have anything in E2)
Ctrl+Shift+Enter in P3 and copy down
CR
在所需输出列的第一个单元格(本例中为 E1)中,输入
其中 B1 是第一个对象的地址。在下面的单元格(此处为 E2)中,输入
并根据需要填写。
In the first cell of your desired output column (E1 in this example), enter
Where B1 is the address of the first object. In the cell below (E2, here), enter
And fill down as far as you require.
假设您的对象数量有限,如示例所示,请尝试以下操作:
在 D3 中,输入此公式:
向下填写此公式(即复制并粘贴)约 10 行,您将看到所有内容都相应填写。
你问它有什么作用?首先,它计算 D 列前面的单元格中“A”出现的次数,并将其与频率进行比较。如果小于,则进入另一个 A。然后对 B 和 C 重复该过程。
Assuming you have a small finite number of objects like in your example, try this:
In D3, enter this formula:
Fill this formula down (i.e. copy&paste) about 10 rows and you'll see everything fill in accordingly.
What does it do, you ask? First, it counts the number of occurrences of "A" in the previous cells of column D and compares it to the frequency. If less, it enters another A. Then that process is repeated for B and C.