在 Excel 中复制值 N 次 [英] Copy value N times in Excel

查看:10
本文介绍了在 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:

  1. 在 A 的左侧插入一列,因此您当前的 A 和 B 列现在是 B 和 C.
  2. 1放入A1
  3. =A1+C1放入A2,向下复制到A5
  4. 在 B5 中放置一个空字符串,只需在单元格中输入一个单引号 (')
  5. 在E1中放一个1,在E2中放一个2,复制下来得到1,2,...,10
  6. =VLOOKUP(E1,$A$1:$B$5,2) 放到 F1 下复制下来.
  1. Insert a column to the left of A, so your current A and B columns are now B and C.
  2. Put 1 in A1
  3. Put =A1+C1 in A2 and copy down to A5
  4. Put an empty string in B5, by just entering a single quote (') in the cell
  5. Put a 1 in E1, a 2 in E2, and copy down as to get 1, 2, ..., 10
  6. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆