Combining text from 2 cells wrapped line for line.

Keljoe2804

New Member
Joined
Nov 5, 2014
Messages
25
Office Version
  1. 365
Platform
  1. Windows
I've created a log system for changes to my spreadsheet. In one column I have a history of due dates, in the other column I have the date they changed. See below.

This is one Cell
Due Date | Date Changed
4/9/23 2/18/23
3/23/23 3/2/23
12/1/23 3/5/23

What I'd like to do is combine these into one cell
4/9/23 - 2/18/23
3/23/23 - 3/2/23
12/1/23 - 3/5/23

With the common methods of combining cells I get this
4/9/23
3/23/23
12/1/23 - 2/18/23
3/2/23
3/5/23

VBA or formula is fine. I can run VBA on changes.

Thanks
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
How about
Excel Formula:
=TEXT(A2,"mm/dd/yy")&" - "&TEXT(B2,"mm/dd/yy")
 
Upvote 0
How about
Excel Formula:
=TEXT(A2,"mm/dd/yy")&" - "&TEXT(B2,"mm/dd/yy")
As mentioned that just creates the result I don't want
With the common methods of combining cells I get this
4/9/23
3/23/23
12/1/23 - 2/18/23
3/2/23
3/5/23
Instead of this
4/9/23 - 2/18/23
3/23/23 - 3/2/23
12/1/23 - 3/5/23
 
Upvote 0
If that is not what you are after, then please post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

What you have posted tells us nothing at-all.
 
Upvote 0
I'm sorry, as much as I'd like to use that tool, I'm on a company computer with very strict limits. I feel like the sample data I provided was pretty clear, but hopefully this provides some clarification.

I have the date log column and the date it changed in another column as well as date dropped. What I want is the final column to the right to contain all of the data from the 3 columns on the left. However some cells have multiple dates with wrapped text and when I try to combine them I get the issue I explained above, where it will first list all the contents from the first column then separate it with a "-" and then it list all of the contents of the next cell. The format I'm looking for is for it to pull the first date from the first column then add the "-" delimiter and pull the first date from the next column, then wrap the text or use char(10), pull the 2nd date from the first column place the "-" delimiter and pull the 2nd date from the 2nd column, an so on. At the end of that, if there is a date dropped it will say "Date Dropped on" and the date from the Date Dropped column.

Date Log | Date Changed | | Final Log Column
1679423770854.png
 
Last edited:
Upvote 0
Also what version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Also what version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
OK done, thanks for the heads up. I'm using 365 and I use Power M Query and VBA
 
Upvote 0
Thanks for that.
How about
Excel Formula:
=TEXTJOIN(CHAR(10),,TEXTSPLIT(A2,CHAR(10))&"-"&TEXTSPLIT(B2,CHAR(10)))
 
Upvote 1
Solution
Thanks for that.
How about
Excel Formula:
=TEXTJOIN(CHAR(10),,TEXTSPLIT(A2,CHAR(10))&"-"&TEXTSPLIT(B2,CHAR(10)))
So it still pulls all contents from cell 1 and then pulls all contents from cell 2. I need it to basically run back and forth between both cells.

Like this:
1679427142241.png
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,483
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top