How to concatenate text & number cells and turn them into date format

kterkuile

New Member
Joined
Dec 10, 2009
Messages
34
Hi all,

I have two columns. Column A contains years, '2010' for example. Column B contains months, 'Jan' or 'Mar' for example. Neither column is in date format. I want to merge them to 'Jan 2010'. Now that's easy enough, but I also want to make the cell a date and i find that much more tricky. In fact I'm lost. Is there anyone who could help me please?

Take care,

Karel
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Final thought: why does it work?

Take care & thanks so much again!

Karel ter Kuile

Well, type this in a cell

Jan2010

What happens? Excel converts it to a date of Jan 1 2010.

here's what happens,
Unless you specifically format your cell as TEXT, Excel will always take your entry, and try to convert it to a number.

And dates are Numbers.
Jan 1 1900 = 1
Jan 2 1900 = 2
Jan 3 1900 = 3
Etc.
Mar 15 2010 = 40252

Excel has several Acceptable Date formats, and it just goes through them to see if what you entered matches an accepted Date format.
If it does, then it enters it as a date.


No just plain old
=B1&A1
That returns a TEXT string of "Jan2010"
The & symbol is a concatenation function, and specifically returns TEXT
So that alone, is specified as text, so Excel Does not try to convert it to a number.
By putting the +0 on it
=(B1&A1)+0
That forces excel to convert it to a number/date.

Hope that helps..
 
Upvote 0
Well, that is so cunning you could put a tail on it and call it a weasel (to quote my favorite comedy character Blackadder). Thanks for the lesson in Excellence.

Take care,

Karel
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,874
Members
452,363
Latest member
merico17

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