Need Formula to change M/dd/yyyy 0:00 to three separate columns, M|D|Y

toddmkl

New Member
Joined
Feb 21, 2019
Messages
8
Hello,

I have a Column K named 'SHIPDATE' and the first date starts in K2 and is in the format 9/27/2017 0:00.

I need to make three separate columns from K2 named MONTH|DAY|YEAR

So for Day I used this formula:

=DAY([@SHIPDATE])

But the output for Day is

1/27/1900 0:00

I'm trying to get it to output 27 instead of 1/27/1900. I'm not sure how to do this.

Thanks!
 
Thanks to Gerald and Steve the FISH I figured this out !! Thanks everyone!

cute meaningful baby boy names



While I was able to do this with everyone's help I have been told it won't work for what we are trying to do. Column K comes from a data source that includes a timestamp. The last three columns are the DAY|MONTH|YEAR columns you helped me with on here via the formatting.

However, since our WHERE clause in SQL points to column K and that Where Clause is for Dates >2018/01/01 it's not displaying the Slicers correctly as you can see. My co-worker said I need to find a way to get rid of the timestamp from Column K and make the last three columns display the correct information without using the format feature or the Slicers will not work because of that timestamp.

Thanks
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Are you actually using a formula to get the day, month, year to display or are you using formatting? I suspect the latter. You need to use the formulas to get the day, month, year in the cells.
 
Upvote 0
Are you actually using a formula to get the day, month, year to display or are you using formatting? I suspect the latter. You need to use the formulas to get the day, month, year in the cells.


I was using formatting but my co-worker advised me that that messes up the backend data. So, I needed to write a formula. So, I ended up using the =INT(SHIPDATE) formula and then doing my =DAY
([@SHIPDATE]) , =MONTH
([@SHIPDATE]) and =YEAR
([@SHIPDATE]) formulas using the INT formulas column as the (@SHIPDATE) to get the data I wanted.

Thanks Steve the Fish!


 
Upvote 0
Day month and year formulas will not be affected by a date that has a time component so the int part is unnecessary. You will still get the same result if it's used or not.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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