ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   function result losing leading zeros (https://www.excelbanter.com/excel-worksheet-functions/200785-function-result-losing-leading-zeros.html)

Cat

function result losing leading zeros
 
I am merging two custom values "0000" together with a dash, and the result
loses the leading zeros. Ex. 0001 and 0101 end up as 1-101 and I want it to
be 0001-0101. Note*The number of leading zeros changes since I have a huge
list of values, so I can't just add the 3 and 1 zero(s) needed in this
example.

using formula =(F7&"-"&G7) AND Custom Format 0000 in the two previous
columns to the function column.

Peo Sjoblom[_2_]

function result losing leading zeros
 
Take a look at the TEXT function in help

--


Regards,


Peo Sjoblom

"cat" wrote in message
...
I am merging two custom values "0000" together with a dash, and the result
loses the leading zeros. Ex. 0001 and 0101 end up as 1-101 and I want it
to
be 0001-0101. Note*The number of leading zeros changes since I have a
huge
list of values, so I can't just add the 3 and 1 zero(s) needed in this
example.

using formula =(F7&"-"&G7) AND Custom Format 0000 in the two previous
columns to the function column.




Cat

function result losing leading zeros
 
when I try to convert the numbers to text I lose my leading zeros?

"Peo Sjoblom" wrote:

Take a look at the TEXT function in help

--


Regards,


Peo Sjoblom

"cat" wrote in message
...
I am merging two custom values "0000" together with a dash, and the result
loses the leading zeros. Ex. 0001 and 0101 end up as 1-101 and I want it
to
be 0001-0101. Note*The number of leading zeros changes since I have a
huge
list of values, so I can't just add the 3 and 1 zero(s) needed in this
example.

using formula =(F7&"-"&G7) AND Custom Format 0000 in the two previous
columns to the function column.





Peo Sjoblom[_2_]

function result losing leading zeros
 
TEXT function not convert to text, if you have for instance F7 formatted as
0000 then when you concatenate it with another cell you need to use the same
format


=TEXT(F7,"0000")&" - "&TEXT(G7,"0000")

--


Regards,


Peo Sjoblom

"cat" wrote in message
...
when I try to convert the numbers to text I lose my leading zeros?

"Peo Sjoblom" wrote:

Take a look at the TEXT function in help

--


Regards,


Peo Sjoblom

"cat" wrote in message
...
I am merging two custom values "0000" together with a dash, and the
result
loses the leading zeros. Ex. 0001 and 0101 end up as 1-101 and I want
it
to
be 0001-0101. Note*The number of leading zeros changes since I have a
huge
list of values, so I can't just add the 3 and 1 zero(s) needed in this
example.

using formula =(F7&"-"&G7) AND Custom Format 0000 in the two previous
columns to the function column.








All times are GMT +1. The time now is 07:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com