在 Excel 中复制值 N 次 [英] Copy value N times in Excel
本文介绍了在 Excel 中复制值 N 次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有简单的清单:
A B
item1 3
item2 2
item3 4
item4 1
需要输出:
A
item1
item1
item1
item2
item2
item3
item3
item3
item3
item4
推荐答案
这是一种不使用 VBA 的方法:
Here is one way of doing it without VBA:
- 在 A 的左侧插入一列,因此您当前的 A 和 B 列现在是 B 和 C.
- 将
1
放入A1 - 将
=A1+C1
放入A2,向下复制到A5 - 在 B5 中放置一个空字符串,只需在单元格中输入一个单引号 (
'
) - 在E1中放一个
1
,在E2中放一个2
,复制下来得到1,2,...,10 - 把
=VLOOKUP(E1,$A$1:$B$5,2)
放到 F1 下复制下来.
- Insert a column to the left of A, so your current A and B columns are now B and C.
- Put
1
in A1 - Put
=A1+C1
in A2 and copy down to A5 - Put an empty string in B5, by just entering a single quote (
'
) in the cell - Put a
1
in E1, a2
in E2, and copy down as to get 1, 2, ..., 10 - Put
=VLOOKUP(E1,$A$1:$B$5,2)
in F1 and copy down.
应该是这样的:
| A | B | C | D | E | F |
|----|-------|---|---|----|-------|
| 1 | item1 | 3 | | 1 | item1 |
| 4 | item2 | 2 | | 2 | item1 |
| 6 | item3 | 4 | | 3 | item1 |
| 10 | item4 | 1 | | 4 | item2 |
| 11 | | | | 5 | item2 |
| | | | | 6 | item3 |
| | | | | 7 | item3 |
| | | | | 8 | item3 |
| | | | | 9 | item3 |
| | | | | 10 | item4 |
这篇关于在 Excel 中复制值 N 次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文