【问题标题】:How to split 1 column in excel into 2 separate columns如何将excel中的1列拆分为2列
【发布时间】:2021-07-20 09:25:48
【问题描述】:

问题

给定一列 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

试过

我已查看此链接中概述的过程:Creating 2 columns from 1 但是这似乎仅适用于具有设置分隔符等的列,因此我认为它不适用于这种情况。

任何方法(最好是最简单的)都将不胜感激。

【问题讨论】:

  • 有机会玩 left() 和 right() 公式吗?我的意思是单位或值是否具有固定长度?
  • 好吧,在这种情况下,单位是磅或盎司,因为重量通常可以从一位数到两位数甚至三位数不等
  • 在这种情况下,它可以是简单的单位可以通过右(a1,6)和重量可以左(a1,len(a1)-6。但是,我在下面发布了更通用的解决方案

标签: excel multiple-columns


【解决方案1】:

我将告诉你使用没有任何公式的快速填充的最简单方法。这适用于任意位数

只需手动填写第一行的数据,如下所示,

Weight and Unit Weight Ounces
10Ounces 10 Ounces
10Pounds
10Pounds
10Pounds
11Pounds

第一步: 选择单元格权重并单击 Ctrl + E 以填充权重列。

第二步: 选择单元格单元并单击 Ctrl + E 以填充单元列。

输出:

Weight and Unit Weight Ounces
10Ounces 10 Ounces
10Pounds 10 Pounds
10Pounds 10 Pounds
10Pounds 10 Pounds
11Pounds 11 Pounds

更多关于 Flash 填充的信息:

数据 -> 数据工具 -> 快速填充

【讨论】:

【解决方案2】:

号码

LEFT(A1,SUM(LEN(A1)-LEN(SUBSTITUTE(A1,{"0","1","2","3","4","5","6"," 7","8","9"},""))))

对于文本

RIGHT(A1, Len(上述值)

【讨论】:

    【解决方案3】:

    在 B 列中:

    =LEFT(A2;MATCH(TRUE;ISERROR(VALUE(MID(A2;ROW(INDIRECT("1:"&LEN(A2)));1)));0)-1)

    在 C 列中:

    =MID(A2;FIND(B2;A2;1)+2;50)

    【讨论】:

      【解决方案4】:

      我喜欢快速填充选项,但如果您使用公式,您可以尝试以下方法:

      B2中的公式:

      =-LOOKUP(1,-LEFT(A2,ROW($1:$99)))
      

      C2中的公式:

      =MID(A2,LEN(B2)+1,99)
      

      【讨论】:

        猜你喜欢
        • 2021-12-07
        • 1970-01-01
        • 2013-04-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多