if a have a column of cells, say from A1 to A150, and each cell contains a
10 digit number, for example xxx1236xxx, how can I parse, or remove the
first 3 digits and the last 3 digits in all the cells?
Ron Rosenfeld - 22 Mar 2008 01:42 GMT
>if a have a column of cells, say from A1 to A150, and each cell contains a
>10 digit number, for example xxx1236xxx, how can I parse, or remove the
>first 3 digits and the last 3 digits in all the cells?
If there will never be a leading zero, then simply:
=MID(A1,4,4) and fill down. This will return the value as text, so if there is
a leading zero in the four digits being returned, that will be retained.
If you wish to convert it to a numeric value, you can precede the formula with
a double unary:
=--MID(A1,4,4)
If there might be leading zero's in your ten digit numbers, then:
=MID(TEXT(A1,"0000000000"),4,4)
or, numerically:
=MOD(INT(A1/10^3),10^4)
--ron
Barb Reinhardt - 22 Mar 2008 01:43 GMT
Try this
=MID(A1,4,len(A1)-6))

Signature
HTH,
Barb Reinhardt
> if a have a column of cells, say from A1 to A150, and each cell contains a
> 10 digit number, for example xxx1236xxx, how can I parse, or remove the
> first 3 digits and the last 3 digits in all the cells?
Cimjet - 22 Mar 2008 01:45 GMT
Hi Walter
See if this is what you want, Just for test select "A1"
Go to 'Data/Text to Columns/ Select Fixed spaces and fallow the menu.
Regards
Cimjet
> if a have a column of cells, say from A1 to A150, and each cell contains a
> 10 digit number, for example xxx1236xxx, how can I parse, or remove the
> first 3 digits and the last 3 digits in all the cells?
Alan - 22 Mar 2008 01:47 GMT
Try
=MID(A1,4,4)*1
The Mid formula removes the first and last three digits but the result would
be text. The *1 converts it back to a number,
Regards,
Alan.
> if a have a column of cells, say from A1 to A150, and each cell contains a
> 10 digit number, for example xxx1236xxx, how can I parse, or remove the
> first 3 digits and the last 3 digits in all the cells?
Walter Kaatz - 23 Mar 2008 14:30 GMT
Thanks to all for the help. =MID did the trick!
> if a have a column of cells, say from A1 to A150, and each cell contains a
> 10 digit number, for example xxx1236xxx, how can I parse, or remove the
> first 3 digits and the last 3 digits in all the cells?
WGD - 23 Mar 2008 18:49 GMT
This group continues to impress me to the hilt. Should have made paper
copies of notable solutions years ago.
The formula used to solve Walter's problem would be very useful to extract
NPAs and NXXs from telephone numbers.
Wayne
> if a have a column of cells, say from A1 to A150, and each cell contains a
> 10 digit number, for example xxx1236xxx, how can I parse, or remove the
> first 3 digits and the last 3 digits in all the cells?