# Formula for first 4 digits

#### Wrecker1

##### New Member
Is there a formula to copy the first four digits in a column to the next column?

in c2..... = ****(b2)?

Not sure how to tell it I want just the first 4 digits.

### Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Try:

=LEFT(B2,4)

Adding the VALUE function returns the digits as numeric values instead of a text string:

=VALUE(LEFT(b2,4))

On 2002-09-17 10:57, cass108 wrote:
Adding the VALUE function returns the digits as numeric values instead of a text string:

=VALUE(LEFT(b2,4))

as would
=LEFT(A4,4)+0

or even dressed up a little more for error trapping:
=IF(ISNUMBER(LEFT(A4,4)+0),LEFT(A4,4)+0,LEFT(A4,4))

This can also be done using the Data | Text to Columns... menu command after selecting your data...

1. At Step 1 of 3 choose "Fixed width" and press [ Next> ]

2. At Step 2 of 3 click in the data preview window to insert a break line after the 4th character from the left, and press [ Next> ]

3. At Step 3 of 3 set the 1st parsed column's data format as desired, set the 2nd column's format to "Do not import column (skip)", set the destination to the cell address of the 1st cell in the column where you want the data to appear, and press [ Finish ].

Voila! ...and, "Look ma', no formulas needed!"
This message was edited by Mark W. on 2002-09-17 12:23

Good to know...When I first looked at this, I didn't think it would work since I expected numbers to appear as nubmers and be right justified in text to columns. I guess text to columns is correctly named!

Yeah, it beats the hell out of the old Data | Parse command.

Replies
8
Views
132
Replies
4
Views
286
Replies
3
Views
230
Replies
15
Views
270
Replies
18
Views
515

1,221,494
Messages
6,160,141
Members
451,624
Latest member
TheWes

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back