如何将 excel 中的 1 列拆分为 2 个单独的列
How to split 1 column in excel into 2 separate columns
问题
给定 weight_and_units 的单列,看起来像:
weight_and_units
10Ounces
10Ounces
10Ounces
10Ounces
10Ounces
10Pounds
10Pounds
10Pounds
10Pounds
10Pounds
11Ounces
11Ounces
11Ounces
11Ounces
11Ounces
11Pounds
11Pounds
11Pounds
11Pounds
11Pounds
12Ounces
12Ounces
12Ounces
12Ounces
12Ounces
我希望能够创建 2 个单独的列,例如
weight
10
11
12
13
和
units
Ounces
Pounds
Pounds
尝试过
我已经研究了这个 link 中概述的过程:Creating 2 columns from 1 但是这似乎只适用于具有设置分隔符等的列,因此我不认为它在这种情况下会起作用。
任何方法(最好是最简单的)来做到这一点将不胜感激。
数量
LEFT(A1,SUM(LEN(A1)-LEN(SUBSTITUTE(A1,{"0","1","2","3","4","5","6" "7","8","9"},""))))
对于文本
RIGHT(A1, Len(以上数值)
在 B 列中:
=LEFT(A2;MATCH(TRUE;ISERROR(VALUE(MID(A2;ROW(INDIRECT("1:"&LEN(A2)));1)));0)-1)
在 C 列中:
=中间(A2;查找(B2;A2;1)+2;50)
我将告诉您最简单的使用快速填充的方法,无需任何公式。这将适用于任意数量的数字
只需手动填写第一行的数据,如下所示,
Weight and Unit
Weight
Ounces
10Ounces
10
Ounces
10Pounds
10Pounds
10Pounds
11Pounds
第一步:
Select 单元格权重并单击 Ctrl + E 以填充权重列。
第二步:
Select单元格单位并单击Ctrl + E填充单位列。
输出:
Weight and Unit
Weight
Ounces
10Ounces
10
Ounces
10Pounds
10
Pounds
10Pounds
10
Pounds
10Pounds
10
Pounds
11Pounds
11
Pounds
有关 Flash 填充的更多信息:
数据 -> 数据工具 -> 快速填充
我喜欢快速填充选项,但如果您使用公式,您可以尝试以下操作:
B2
中的公式:
=-LOOKUP(1,-LEFT(A2,ROW(:)))
C2
中的公式:
=MID(A2,LEN(B2)+1,99)
问题
给定 weight_and_units 的单列,看起来像:
weight_and_units
10Ounces
10Ounces
10Ounces
10Ounces
10Ounces
10Pounds
10Pounds
10Pounds
10Pounds
10Pounds
11Ounces
11Ounces
11Ounces
11Ounces
11Ounces
11Pounds
11Pounds
11Pounds
11Pounds
11Pounds
12Ounces
12Ounces
12Ounces
12Ounces
12Ounces
我希望能够创建 2 个单独的列,例如
weight
10
11
12
13
和
units
Ounces
Pounds
Pounds
尝试过
我已经研究了这个 link 中概述的过程:Creating 2 columns from 1 但是这似乎只适用于具有设置分隔符等的列,因此我不认为它在这种情况下会起作用。
任何方法(最好是最简单的)来做到这一点将不胜感激。
数量
LEFT(A1,SUM(LEN(A1)-LEN(SUBSTITUTE(A1,{"0","1","2","3","4","5","6" "7","8","9"},""))))
对于文本
RIGHT(A1, Len(以上数值)
在 B 列中:
=LEFT(A2;MATCH(TRUE;ISERROR(VALUE(MID(A2;ROW(INDIRECT("1:"&LEN(A2)));1)));0)-1)
在 C 列中:
=中间(A2;查找(B2;A2;1)+2;50)
我将告诉您最简单的使用快速填充的方法,无需任何公式。这将适用于任意数量的数字
只需手动填写第一行的数据,如下所示,
Weight and Unit | Weight | Ounces |
---|---|---|
10Ounces | 10 | Ounces |
10Pounds | ||
10Pounds | ||
10Pounds | ||
11Pounds |
第一步: Select 单元格权重并单击 Ctrl + E 以填充权重列。
第二步: Select单元格单位并单击Ctrl + E填充单位列。
输出:
Weight and Unit | Weight | Ounces |
---|---|---|
10Ounces | 10 | Ounces |
10Pounds | 10 | Pounds |
10Pounds | 10 | Pounds |
10Pounds | 10 | Pounds |
11Pounds | 11 | Pounds |
有关 Flash 填充的更多信息:
数据 -> 数据工具 -> 快速填充
我喜欢快速填充选项,但如果您使用公式,您可以尝试以下操作:
B2
中的公式:
=-LOOKUP(1,-LEFT(A2,ROW(:)))
C2
中的公式:
=MID(A2,LEN(B2)+1,99)