ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Formatted cells in a formula? (https://www.excelbanter.com/excel-discussion-misc-queries/153113-formatted-cells-formula.html)

Amatus39

Formatted cells in a formula?
 
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!

Pete_UK

Formatted cells in a formula?
 
Try this:

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

Hope this helps.

Pete

On Aug 6, 3:20 pm, Amatus39
wrote:
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!




Max

Formatted cells in a formula?
 
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
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Amatus39" wrote:
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!



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

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