[excel] In Excel how to get the left 5 characters of each cell in a specified column and put them into a new column

I want to take the left 5 characters of each cell in column E and put them into the adjoining cell in column 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"?

This question is related to excel excel-formula

The answer is


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

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


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.


Have you tried using the "auto-fill" in 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).