Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 355
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 770
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,651
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 355
Default 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
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
date Concatenation gb_S49 Excel Worksheet Functions 6 April 11th 10 02:54 PM
Date in Concatenation FARAZ QURESHI Excel Discussion (Misc queries) 2 September 20th 07 04:55 PM
Format and Concatenation C Brandt Excel Discussion (Misc queries) 3 May 29th 07 11:26 PM
Trouble with concatenation number format FJ Excel Worksheet Functions 2 March 4th 07 04:39 AM
format/concatenation alm09 Excel Worksheet Functions 1 October 6th 06 06:35 PM


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