Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date format and concatenation
Hello -
I have info in two cells that needs to be concatenated into one cell (Cell E30) as follows: (Some 8-digit number)(hyphen)(date in format of yyddmm).xls An example would be 87654321-052808.xls The 8-digit number is in cell H16 and the date is in cell H18. The format for the date cell is set at dd/mm/yyyy. I've tried putting this into a function, but keep getting errors. Any suggestions will be immensely appreciated. -- Sandy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date format and concatenation
Sandy,
Range("E30") = Range("H16") & "-" & Format(Range("H18"), "yyddmm") & ".xls" hth, Doug "Sandy" wrote in message ... Hello - I have info in two cells that needs to be concatenated into one cell (Cell E30) as follows: (Some 8-digit number)(hyphen)(date in format of yyddmm).xls An example would be 87654321-052808.xls The 8-digit number is in cell H16 and the date is in cell H18. The format for the date cell is set at dd/mm/yyyy. I've tried putting this into a function, but keep getting errors. Any suggestions will be immensely appreciated. -- Sandy |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date format and concatenation
On Sat, 27 Aug 2005 19:29:01 -0700, "Sandy"
wrote: Hello - I have info in two cells that needs to be concatenated into one cell (Cell E30) as follows: (Some 8-digit number)(hyphen)(date in format of yyddmm).xls An example would be 87654321-052808.xls The 8-digit number is in cell H16 and the date is in cell H18. The format for the date cell is set at dd/mm/yyyy. I've tried putting this into a function, but keep getting errors. Any suggestions will be immensely appreciated. Assuming you want the number from H16 to always have 8 digits (i.e. add leading 0's if necessary) and that the value in H18 is a real Excel date, then: =TEXT(H16,"00000000\-")&TEXT(H18,"YYDDMM")&".xls" --ron |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Date format and concatenation
Hi Doug and Ron -
Thanks to both of you. Both solutions work beautifully! -- Sandy "Sandy" wrote: Hello - I have info in two cells that needs to be concatenated into one cell (Cell E30) as follows: (Some 8-digit number)(hyphen)(date in format of yyddmm).xls An example would be 87654321-052808.xls The 8-digit number is in cell H16 and the date is in cell H18. The format for the date cell is set at dd/mm/yyyy. I've tried putting this into a function, but keep getting errors. Any suggestions will be immensely appreciated. -- Sandy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
date Concatenation | Excel Worksheet Functions | |||
Date in Concatenation | Excel Discussion (Misc queries) | |||
Format and Concatenation | Excel Discussion (Misc queries) | |||
Trouble with concatenation number format | Excel Worksheet Functions | |||
format/concatenation | Excel Worksheet Functions |