Format 'General' year to actual year

kiwichick

New Member
Joined
Feb 16, 2007
Messages
13
I'm using Excel 2007 so I hope it's not too old to achieve what I'd like.

I have a table I've copied from online. The date column is formatted with each date separated into two cells, one above the other.
The first cell is formatted for 'Custom' d-mmm and the content is the day and month. For example: 17-Jun
The second cell is formatted for 'General' and the content is the year that goes with the above cell. For example: 2021

I want to merge them into a single cell but can't because they're different data values. How do I format these cells so they can be merged into a date of 17-Jun-2021? (The separator can be anything.) I thought I could just convert the year cell to 'Custom' yyyy but it didn't work. Instead of it staying 2021 it changed to 1905.

And, if it is possible, can I apply it to the whole column at once rather than doing each set of two cells separately?
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Try this:

=DATEVALUE(TEXT(A2,"dd-mmm")&"-"&B2)
I forgot to mention that I did have to change the format of the new, merged cell to Date. And once I've applied this to all the relevant cells, what do I need to do so that I can delete the original column?
 
Upvote 0
You can copy and paste values, and then delete the original column
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,044
Members
449,063
Latest member
ak94

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