Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default ConvertTextToNumbers

I have a column with numbers in them with a leading blank, like below.
'5179455010055341
I want to copy them to another column and have them formatted like below:

5179 4550 1005 5341

I was using Data TextToColumns with a space and ' for delimiters, but I
end up with the last digit of each number being 0, like below.

5179 4550 1005 5340

I am using #### #### #### #### for the formatting and Excel 97. How can
I get the values copied and formatted correctly, without altering the
digits?

TIA

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 510
Default ConvertTextToNumbers

Hi,

First use the formula :
=VALUE(TRIM(A1))
Then use Format Cells Number Custom to input your format #### #### ####
####

HTH
Cheers
Carim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default ConvertTextToNumbers

Carim:

I do not understand the steps to take to make this work. When I try to
use =VALUE(TRIM(A1)), I get the following error in cell B1 #VALUE!.

Thanks

Carim wrote:

Hi,

First use the formula :
=VALUE(TRIM(A1))
Then use Format Cells Number Custom to input your format #### #### ####
####

HTH
Cheers
Carim


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default ConvertTextToNumbers

These appear to be credit card numbers, so the problem is that excel only
supports 15 digits of precision when working with numbers. The reason the
space is there is so they will be treated as text and you won't loose the
last digit. To break them apart use formulas. Assume the first number is in
A2
in B2
=Mid(A2,2,4)
in C2
=Mid(A2,6,4)
in D2
=Mid(A2,10,2)
in E2
=Mid(A2,14,4)

then select B2:E2 and drag fill down the column.

--
Regards,
Tom Ogilvy


"Carim" wrote:

Hi,

First use the formula :
=VALUE(TRIM(A1))
Then use Format Cells Number Custom to input your format #### #### ####
####

HTH
Cheers
Carim


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"