Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default specify data size in cell add 0's

I want to specify that if data I am importing is 5556946581 it will return as
0000005556946580. It will add 0's to the beginning to make the length 16
characters long and also change the last number to 0 if it is a number from
1-9
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default specify data size in cell add 0's

Something like this:

=TEXT(MID(A2,1,LEN(A2)-1)&0,"0000000000000000")

Note that if you need this to be a number, you can use:
=VALUE(MID(A2,1,LEN(A2)-1)&0)
and just format cells - number tab, custom format of
0000000000000000
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"donna13pa" wrote:

I want to specify that if data I am importing is 5556946581 it will return as
0000005556946580. It will add 0's to the beginning to make the length 16
characters long and also change the last number to 0 if it is a number from
1-9

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default specify data size in cell add 0's

Hi,

I'd import your data and leave it as is and convert to the format you want
with a formula. Say you imported to column A, put this in b1 and drag down

=REPT("0",16-LEN(A1))&LEFT(A1,LEN(A1)-1)&"0"

Mike

"donna13pa" wrote:

I want to specify that if data I am importing is 5556946581 it will return as
0000005556946580. It will add 0's to the beginning to make the length 16
characters long and also change the last number to 0 if it is a number from
1-9

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy worksheet1 to worksheet2, keep cell format eg cell size slocookie Excel Discussion (Misc queries) 2 January 8th 10 11:24 AM
How do I have a linked cell auto-size to fit the linked data? CristinPDX Excel Discussion (Misc queries) 0 June 24th 08 08:42 PM
Set Circle Size from cell data? Colby Excel Discussion (Misc queries) 2 April 11th 07 04:56 PM
cell size and font size Aamir Excel Discussion (Misc queries) 1 October 10th 06 05:51 PM
Cell size? Or size limit for Text data type? CClem Excel Discussion (Misc queries) 0 April 21st 06 04:09 PM


All times are GMT +1. The time now is 06:48 PM.

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"