Need to create date from 3 cells (1 with yr; 1 with month; 1 with day)

Sleeplol

Board Regular
Joined
Apr 10, 2019
Messages
194
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi,

Is there a way to get a legitimate date from pulling the day, month, and year values from different cells??

For instance: Year in A2 and Month in B2 (Both A2 & B2 are drop downs), and C2 - AG2 are the days 1,2,3, etc

I'd like to have row C1 - AG1 display an actual excel date (or number) so that I can work in a holiday list via another formula.

However, my holiday list with is formula driven can only properly reference the cells C1 - AG1 if they are actual dates
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Are the months entered as Jan, Feb, etc, or as 01, 02?

Also, what is your regional date format? The formula needs to be specific to your system settings. If I write it for UK dates then it will error with US dates. If you're using month names in a language other than English then that may need to be allowed for as well.
 
Upvote 0
Hi Jasonb75

The data is simply a value in each cell:
1668455188770.png

I'd like it to look like:
1668455397609.png

or even better:
1668455456476.png
 

Attachments

  • 1668455150342.png
    1668455150342.png
    3.1 KB · Views: 10
Upvote 0
You didn't answer the important bit.
what is your regional date format? The formula needs to be specific to your system settings. If I write it for UK dates then it will error with US dates.
 
Upvote 0
Yep, that's what I was asking. Sorry, if I had been paying attention then I would have noticed it in the screen capture that you posted earlier :oops:

Enter this formula into C1 and drag right to get what you need.
Excel Formula:
=DATEVALUE($B2&" "&C2&" "&$A2)
It will most likely show the date serial number by default but you can change it to a proper date by formatting the cells if required.
 
Upvote 0
Hi Jasonb75,

Thanks for getting back, but I'm getting an error...

1668470109147.png
 
Upvote 0
I can't actually test the formula because my regional settings are different but based on the information from you and the screen capture in post 3, it should work.

See if any of these work correctly.
=DATEVALUE(LEFT($B2,3)&"-"&C2&"-"&$A2)
=DATEVALUE($A2&"-"&LEFT($B2,3)&"-"&C2)
=DATEVALUE(C2&"-"&LEFT($B2,3)&"-"&$A2)

edit:-

Think the original needed another comma
=DATEVALUE($B2&" "&C2&", "&$A2)
 
Upvote 0
Solution
=DATEVALUE($B2&" "&C2&", "&$A2) Works Perfectly!!!!!

I've been puttering around with this way too long and you solved it in a snap.
Many many thanks!!
 
Upvote 0

Forum statistics

Threads
1,215,876
Messages
6,127,490
Members
449,385
Latest member
KMGLarson

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