Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
DBavirsha
 
Posts: n/a
Default Leading Zeros in Numeric Values

I need to combine or concatenate, two, three-digit values into one, six-digit
value. For example, in column A, I have the value 123 and in column B, I
have the value 456. In column C, I concatenate A & B into the text 123456.
I run into a problem when the three digit values in columns A and B contain
leading zeros, such as 031, 002, 067, etc. How do I combine or concatenate
the two, three-digit values into one, six-digit value when one or both of the
three-digit values contain leading zeros?
  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

C1: =TEXT(A1,"000") & TEXT(B1,"000")

In article ,
DBavirsha wrote:

I need to combine or concatenate, two, three-digit values into one, six-digit
value. For example, in column A, I have the value 123 and in column B, I
have the value 456. In column C, I concatenate A & B into the text 123456.
I run into a problem when the three digit values in columns A and B contain
leading zeros, such as 031, 002, 067, etc. How do I combine or concatenate
the two, three-digit values into one, six-digit value when one or both of the
three-digit values contain leading zeros?

  #3   Report Post  
Jason Morin
 
Posts: n/a
Default

=TEXT(A1,"000")&TEXT(B1,"000")

HTH
Jason
Atlanta, GA

-----Original Message-----
I need to combine or concatenate, two, three-digit

values into one, six-digit
value. For example, in column A, I have the value 123

and in column B, I
have the value 456. In column C, I concatenate A & B

into the text 123456.
I run into a problem when the three digit values in

columns A and B contain
leading zeros, such as 031, 002, 067, etc. How do I

combine or concatenate
the two, three-digit values into one, six-digit value

when one or both of the
three-digit values contain leading zeros?
.

  #4   Report Post  
Edgar Thoemmes
 
Posts: n/a
Default

As long as both values that you are concatenating are stored as text values
they should concatenate fine.

Check the Cell Format and make sure you have selected text.

"DBavirsha" wrote:

I need to combine or concatenate, two, three-digit values into one, six-digit
value. For example, in column A, I have the value 123 and in column B, I
have the value 456. In column C, I concatenate A & B into the text 123456.
I run into a problem when the three digit values in columns A and B contain
leading zeros, such as 031, 002, 067, etc. How do I combine or concatenate
the two, three-digit values into one, six-digit value when one or both of the
three-digit values contain leading zeros?

  #5   Report Post  
DBavirsha
 
Posts: n/a
Default

Thank you, Jason! Your formula was what I needed.

Dave

"Jason Morin" wrote:

=TEXT(A1,"000")&TEXT(B1,"000")

HTH
Jason
Atlanta, GA

-----Original Message-----
I need to combine or concatenate, two, three-digit

values into one, six-digit
value. For example, in column A, I have the value 123

and in column B, I
have the value 456. In column C, I concatenate A & B

into the text 123456.
I run into a problem when the three digit values in

columns A and B contain
leading zeros, such as 031, 002, 067, etc. How do I

combine or concatenate
the two, three-digit values into one, six-digit value

when one or both of the
three-digit values contain leading zeros?
.




  #6   Report Post  
DBavirsha
 
Posts: n/a
Default

Thank you, JE! Your formula is what I was looking for.

Dave

"JE McGimpsey" wrote:

One way:

C1: =TEXT(A1,"000") & TEXT(B1,"000")

In article ,
DBavirsha wrote:

I need to combine or concatenate, two, three-digit values into one, six-digit
value. For example, in column A, I have the value 123 and in column B, I
have the value 456. In column C, I concatenate A & B into the text 123456.
I run into a problem when the three digit values in columns A and B contain
leading zeros, such as 031, 002, 067, etc. How do I combine or concatenate
the two, three-digit values into one, six-digit value when one or both of the
three-digit values contain leading zeros?


  #7   Report Post  
DBavirsha
 
Posts: n/a
Default

The values are stored as numeric values, not text. they are formatted with
the custom formatting 000. Converting a numberic value that contains one or
more leading zeros to text by using the format cells, text command will
remove the leading zeros from the numeric value. Thanks for your response,
the formula provided by Jason and JE is what I was looking for.

Dave

"Edgar Thoemmes" wrote:

As long as both values that you are concatenating are stored as text values
they should concatenate fine.

Check the Cell Format and make sure you have selected text.

"DBavirsha" wrote:

I need to combine or concatenate, two, three-digit values into one, six-digit
value. For example, in column A, I have the value 123 and in column B, I
have the value 456. In column C, I concatenate A & B into the text 123456.
I run into a problem when the three digit values in columns A and B contain
leading zeros, such as 031, 002, 067, etc. How do I combine or concatenate
the two, three-digit values into one, six-digit value when one or both of the
three-digit values contain leading zeros?

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
Format a cell to keep leading zeros. Shadyhosta New Users to Excel 5 July 27th 05 04:37 PM
Second serie doesn't use X-as values JackRnl Charts and Charting in Excel 1 January 20th 05 01:04 AM
Adding Leading Zeros to Text Jenn Excel Discussion (Misc queries) 4 January 12th 05 06:51 PM
How do I display leading zeros so I can export a fixed in Excel? World Referee and accountant Excel Discussion (Misc queries) 2 January 3rd 05 04:18 PM
Insert Leading Zeros hkslater Excel Worksheet Functions 7 November 16th 04 11:28 PM


All times are GMT +1. The time now is 06:36 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"