Combine Multiple Date & Time groups into one Cell

matthewajackson13

New Member
Joined
Aug 29, 2019
Messages
2
I am trying to merge 4 date and time cells together into 1 cell. I am using the following formula:

=CONCATENATE(TEXT(Table_query__42[@[Soft Lock 1 End]],"mm/dd/yyyy h:mm AM/PM"), "; ",TEXT(Table_query__42[@[Soft Lock 1 Start]], "mm/dd/yyy h:mm AM/PM"), "; ",TEXT(Table_query__42[@[Soft Lock 2 End]], "mm/dd/yyy h:mm AM/PM"),"; ",TEXT(Table_query__42[@[Soft Lock 2 Start]], "mm/dd/yyyy h:mm AM/PM"))

It is working to combine all of the dates however, the blank fields are showing up as 01/00/1900 12:00 AM.

I would like the blank fields to show up blank.

Is there a way to combine 4 date and time cells together and exclude blank cells? I have tried to combine the cells without the formatting however, it brings them together as just numbers and not dates.

Any help would be great. Some example data set below:

[TABLE="width: 500"]
<tbody>[TR]
[TD]09/25/2019 8:00 AM[/TD]
[TD]9/25/2019 12:00 PM[/TD]
[TD]10/01/2019 8:00 AM[/TD]
[TD]10/01/2019 12:00 PM[/TD]
[/TR]
[TR]
[TD]9/25/2019 8:00 AM

[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]09/25/2019 8:00 AM[/TD]
[TD]9/25/2019 12:00 PM

[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi, welcome to the board.

Perhaps something like replacing
TEXT(Table_query__42[@[Soft Lock 1 Start]], "mm/dd/yyy h:mm AM/PM")

with
IF(Table_query__42[@[Soft Lock 1 Start]]=0,"",TEXT(Table_query__42[@[Soft Lock 1 Start]], "mm/dd/yyy h:mm AM/PM"))
 
Upvote 0
Thanks!

I think I figured it out. I did a version of what you have above.

=CONCATENATE((IF(Table_query__42[@[Soft Lock 1 End]], TEXT(Table_query__42[@[Soft Lock 1 End]],"mm/dd/yyyy h:mm AM/PM"),"")),"; ",(IF(Table_query__42[@[Soft Lock 1 Start]],TEXT(Table_query__42[@[Soft Lock 1 Start]], "mm/dd/yyyy h:mm AM/PM"),"")),"; ",(IF(Table_query__42[@[Soft Lock 2 End]],TEXT(Table_query__42[@[Soft Lock 2 End]], "mm/dd/yyyy h:mm AM/PM"),"")),"; ",(IF(Table_query__42[@[Soft Lock 2 Start]],TEXT(Table_query__42[@[Soft Lock 2 Start]],"mm/dd/yyy h:mm AM/PM"),"")))

Thank you for your help!!!
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,215
Members
452,618
Latest member
Tam84

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