在Excel中,如何在指定的列中获取每个单元格的左5个字符,并将它们放入新的列中

时间:2021-09-25 13:41:49

I want to take the left 5 characters of each cell in column E and put them into the adjoining cell in column F:

我想取E列中每个单元格的左5个字符,放到F列中相邻的单元格中:

A...B....C...D......E..................F
123.bb...cc..dd.....90210ABCE13........90210
555.bb...cc..dd.....10056Z19s..........10056

Using Left(x, 5) function, how does Excel say "do this to every cell in the specified column"?

使用左(x, 5)函数,Excel如何对指定列中的每个单元格执行此操作?

3 个解决方案

#1


27  

1) Put =Left(E1,5) in F1

1)在F1中放置=Left(E1,5)。

2) Copy F1, then select entire F column and paste.

2)复制F1,然后选择整个F列和粘贴。

#2


1  

I find, if the data is imported, you may need to use the trim command on top of it, to get your details. =LEFT(TRIM(B2),8) In my case, I was using it to find a IP range. 10.3.44.44 with mask 255.255.255.0, so response is: 10.3.44 Kind of handy.

我发现,如果数据是导入的,您可能需要在上面使用trim命令来获取详细信息。=LEFT(TRIM(B2),8)在我的例子中,我使用它来找到一个IP范围。10.3.44.44掩模255.255.255.0,响应是:10.3.44,方便。

#3


0  

Have you tried using the "auto-fill" in Excel?

你试过在Excel中使用“自动填充”吗?

If you have an entire column of items you put the formula in the first cell, make sure you get the result you desire and then you can do the copy/paste, or use auto fill which is an option that sits on the bottom right corner of the cell.

如果你有一整列的项目你把公式放在第一个单元格中,确保你得到你想要的结果,然后你可以做复制/粘贴,或者使用自动填充,这是一个位于单元格右下角的选项。

You go to that corner in the cell and once your cursor changes to a "+", you can double-click on it and it should populate all the way down to the last entry (as long as there are no populated cells, that is).

你进入单元格的那个角落,当你的光标变成一个“+”,你可以双击它,它应该会一直填充到最后一个条目(只要没有填充的单元格,那就是)。

#1


27  

1) Put =Left(E1,5) in F1

1)在F1中放置=Left(E1,5)。

2) Copy F1, then select entire F column and paste.

2)复制F1,然后选择整个F列和粘贴。

#2


1  

I find, if the data is imported, you may need to use the trim command on top of it, to get your details. =LEFT(TRIM(B2),8) In my case, I was using it to find a IP range. 10.3.44.44 with mask 255.255.255.0, so response is: 10.3.44 Kind of handy.

我发现,如果数据是导入的,您可能需要在上面使用trim命令来获取详细信息。=LEFT(TRIM(B2),8)在我的例子中,我使用它来找到一个IP范围。10.3.44.44掩模255.255.255.0,响应是:10.3.44,方便。

#3


0  

Have you tried using the "auto-fill" in Excel?

你试过在Excel中使用“自动填充”吗?

If you have an entire column of items you put the formula in the first cell, make sure you get the result you desire and then you can do the copy/paste, or use auto fill which is an option that sits on the bottom right corner of the cell.

如果你有一整列的项目你把公式放在第一个单元格中,确保你得到你想要的结果,然后你可以做复制/粘贴,或者使用自动填充,这是一个位于单元格右下角的选项。

You go to that corner in the cell and once your cursor changes to a "+", you can double-click on it and it should populate all the way down to the last entry (as long as there are no populated cells, that is).

你进入单元格的那个角落,当你的光标变成一个“+”,你可以双击它,它应该会一直填充到最后一个条目(只要没有填充的单元格,那就是)。