Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
exceldoofus
 
Posts: n/a
Default preserving format in a formula


I'm trying to concatenate two columns in a spreadsheet that contain date
information. I want the data concatenated into a new column with the
dates separated by a ~. I found a formula that does the concatenation
correctly, BUT, it converts my dates to the numerical value associated
with the dates.

My husband suggested putting in an apostrophe before the dates in the
originating cell. Sure enough, when I tried that, the formulated column
converted to the value I wanted. We then wrote a macro that we thought
would allow me to quickly convert all the 10k rows in my spreadsheet.
But, the macro wants to preserve the date info for the cell from which
it was recorded. So, we had a macro that was F2 (edit); Home (took me
to the front of the cell); ‘ (add the apostrophe); <enter We thought
it was awesome until we realized each time we ran the macro.. though it
was turning the formulated cell into a date, it was the date from the
macro, not the correct one.

Does anyone know how to either a) preserve the date format from the
gitgo or b) create a macro that is intuitive enough to work off of the
contents of each cell. FYI, I've tried paste special...I've tried
tweaking the cell format to text etc..but to no avail.

Here's an example of how the data looks and what my formula is:

Column 1 Column 2 Formula
Column (=A2&"~ "&B2)
01/13/2000 02/29/2000 36538~36585

Any help would be HUGELY appreciated. If I don't solve this I may have
to hand concatenate each and every cell -- all 10k of them.

Thank you.


--
exceldoofus
------------------------------------------------------------------------
exceldoofus's Profile: http://www.excelforum.com/member.php...o&userid=28039
View this thread: http://www.excelforum.com/showthread...hreadid=475453

  #2   Report Post  
Alok
 
Posts: n/a
Default

Try this method of concatenation(assuming your dates are in A1 and B1)

=TEXT(A1,"mm/dd/yy") & "---" & TEXT(B1,"mm/dd/yy")

Alok

"exceldoofus" wrote:


I'm trying to concatenate two columns in a spreadsheet that contain date
information. I want the data concatenated into a new column with the
dates separated by a ~. I found a formula that does the concatenation
correctly, BUT, it converts my dates to the numerical value associated
with the dates.

My husband suggested putting in an apostrophe before the dates in the
originating cell. Sure enough, when I tried that, the formulated column
converted to the value I wanted. We then wrote a macro that we thought
would allow me to quickly convert all the 10k rows in my spreadsheet.
But, the macro wants to preserve the date info for the cell from which
it was recorded. So, we had a macro that was F2 (edit); Home (took me
to the front of the cell); €˜ (add the apostrophe); <enter We thought
it was awesome until we realized each time we ran the macro.. though it
was turning the formulated cell into a date, it was the date from the
macro, not the correct one.

Does anyone know how to either a) preserve the date format from the
gitgo or b) create a macro that is intuitive enough to work off of the
contents of each cell. FYI, I've tried paste special...I've tried
tweaking the cell format to text etc..but to no avail.

Here's an example of how the data looks and what my formula is:

Column 1 Column 2 Formula
Column (=A2&"~ "&B2)
01/13/2000 02/29/2000 36538~36585

Any help would be HUGELY appreciated. If I don't solve this I may have
to hand concatenate each and every cell -- all 10k of them.

Thank you.


--
exceldoofus
------------------------------------------------------------------------
exceldoofus's Profile: http://www.excelforum.com/member.php...o&userid=28039
View this thread: http://www.excelforum.com/showthread...hreadid=475453


  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Wed, 12 Oct 2005 10:38:45 -0500, exceldoofus
wrote:


I'm trying to concatenate two columns in a spreadsheet that contain date
information. I want the data concatenated into a new column with the
dates separated by a ~. I found a formula that does the concatenation
correctly, BUT, it converts my dates to the numerical value associated
with the dates.

My husband suggested putting in an apostrophe before the dates in the
originating cell. Sure enough, when I tried that, the formulated column
converted to the value I wanted. We then wrote a macro that we thought
would allow me to quickly convert all the 10k rows in my spreadsheet.
But, the macro wants to preserve the date info for the cell from which
it was recorded. So, we had a macro that was F2 (edit); Home (took me
to the front of the cell); ‘ (add the apostrophe); <enter We thought
it was awesome until we realized each time we ran the macro.. though it
was turning the formulated cell into a date, it was the date from the
macro, not the correct one.

Does anyone know how to either a) preserve the date format from the
gitgo or b) create a macro that is intuitive enough to work off of the
contents of each cell. FYI, I've tried paste special...I've tried
tweaking the cell format to text etc..but to no avail.

Here's an example of how the data looks and what my formula is:

Column 1 Column 2 Formula
Column (=A2&"~ "&B2)
01/13/2000 02/29/2000 36538~36585

Any help would be HUGELY appreciated. If I don't solve this I may have
to hand concatenate each and every cell -- all 10k of them.

Thank you.


I believe the formula you want to use is:

=TEXT(A2,"mm/dd/yyyy") & " - " & TEXT(B2,"mm/dd/yyyy")

Copy/drag down as far as necessary.




--ron
  #4   Report Post  
exceldoofus
 
Posts: n/a
Default


Oh my gosh. Thank you so much. That worked!!!


--
exceldoofus
------------------------------------------------------------------------
exceldoofus's Profile: http://www.excelforum.com/member.php...o&userid=28039
View this thread: http://www.excelforum.com/showthread...hreadid=475453

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
Conditional format with a formula Mike Echo Excel Worksheet Functions 6 July 19th 05 11:05 AM
Creating a check mark box MarthaSue Setting up and Configuration of Excel 18 April 28th 05 12:31 AM
How do I copy a conditional format that uses a formula in a serie. TygerJ Setting up and Configuration of Excel 1 March 31st 05 01:07 AM
date format within a cell containing a formula Brushie76 Excel Discussion (Misc queries) 1 January 22nd 05 03:50 AM
How do I format a character from a result of formula in excel? Mohamed Excel Discussion (Misc queries) 2 December 9th 04 09:43 AM


All times are GMT +1. The time now is 04:38 PM.

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"