Formatted cells in a formula?

A

Amatus39

I am trying to combine columns into one so that I can have one column with
the numbers I want. I have three different sets of number that I want in one
column seperated by a "-" I know how to do this except I can't get the
formula to copy the number formats I have in the cells it is combining. For
example, in one cell I have 001 then the next 02 then 01. When I try to
combine, excel combines this as 1-2-1. I want the "0's" in the number! I
want the combination to read 001-02-01. How do I do this? Any help would be
great!
 
P

Pete_UK

Try this:

=TEXT(A1,"000")&"-"&TEXT(B1,"00")&"-"&TEXT(C1,"00")

Hope this helps.

Pete
 
M

Max

Use TEXT in the concats, eg in D1:
=TEXT(A1,"000")&"-"&TEXT(B1,"00")&"-"&TEXT(C1,"00")
assuming the source numbers are in A1:C1

Copy D1 down as required
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top