Concatenate and retain formatting

geewhysee

New Member
Joined
Jan 7, 2016
Messages
32
Hi,

I have a spreadsheet that auto imports data and then does further calculations. In cell A1 I have a date/time value in format dd/mm/yyyy hh:mm:ss I have chopped this using the formula =int(A2) in cell K2 with the format dd/mm/yyyy and determined the day using the formula =weekday(K2) in cell Q2 with the format ddd.

I want to bring together K2 and Q2 in cell R2 so that it will show eg

Mon 11/04/2016 for today

However when I use =Q2&" "&K2 I get "2 42471" in R2 obviously it hasn't retained the formatting. I have tried using Format Cells... and typing

ddd dd/mm/yyyy

into custom format type but that has not had an effect I'm guessing it's not a valid format.

Any ideas?
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
When you Concatenate, it concatenate the "base" values, the values that are really in there (not the formatted values).
Since dates are stored as the number of days since 1/1/1900, you will get values like "42471".

If you want to include formatting, use the TEXT function, i.e.
=TEXT(Q2,"ddd") & TEXT(K2,"dd/mm/yyyy")
 
Upvote 0

Forum statistics

Threads
1,215,597
Messages
6,125,741
Members
449,256
Latest member
Gavlaar

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