Time is of prime importance and having dates in your data is most of the time essential bit of whole. However, making the dates look the way we want is often cumbersome in spreadsheets as sometimes it changes, flips on its own or it doesn’t work the way want it to. This definitely frustrates many and I was one of them. But soon I learnt its not the Excel that has any problem, its just my lack of knowledge to tame Excel the way I want it to work.
Have a look at the different formats that we might desire for the same date:
Want to learn how to do this? That’s where my favourite feature Customer Number Formatting comes handy. Yes dates are considered numbers by Excel.
Using predetermined / built-in formats
Excel offers you great variety of preformatted options to display date. By default dates your shown in the following format: month/day/year. And these are all in numbers. To change the format to a certain predefined format, select the cell holding date and hit Ctrl+1. This will open format cell dialogue box with number tab active.
From the list on left select date and on the right you will get several options as show below:
As you can see, it can suffice most of the needs of most of the users. But definitely not everyone. For example, What if you want the dates to show up like this:
September (09) 22 (Thursday), 2011
In this case predefined formats are not going to help. But we can still do it if we really know how to harness the power of Customer formatting in Excel. And this is exactly what this article is about.
Custom Date Formats with Customer Formatting
Write the the following date in any cell:
Having the cell containing date selected hit Ctrl+1 to open the same format cell dialogue box. But this time from the left select custom. Now in the type field you can punch in any of the following codes and pay attention how it is affecting the results. You can see the effect on run time basis just above the type field also. Following animation shows:
I have summarized how each of the code affects the date and what it shows. Have a a look at the following table:
|8/6/1986||d||6||Just the day with no leading zero|
|8/6/1986||dd||06||Just the day with leading zero|
|8/6/1986||ddd||Wed||Day in short words|
|8/6/1986||dddd||Wednesday||Day in full words|
|8/6/1986||m||8||Just the month with no leading zero|
|8/6/1986||mm||08||Just the month with leading zero|
|8/6/1986||mmm||Aug||Month in short words|
|8/6/1986||mmmm||August||Month in full words|
|8/6/1986||yy||86||Just the year with no leading century|
|8/6/1986||yyyy||1986||Just the year with leading century|
Once we understand how each of them works, we can workout our own formats the way we want. Just toss them up with dashes or obliques or periods or just the way you want. But lets try the one we wanted in the beginning which was: September (09) 22 (Monday), 2014
Just insert this date in the desired cell and give the following format code:
mmmm (mm) dd (dddd), yyyy
Bonus Tip 1: Showing Month Initials
While going through predefined date formats, I saw a date format which was odd and was like this:
Later I found that you can show months as initials as well. For example the month of September can be displayed as “S” only. And for this you need to put the following code:
Yes five times m in the format code. And this is only for the month as I so far know and does not work for Days or Years portion of the date.
Bonus Tip 2: WHAT THE ####!
Just in case you format the date and you get this:
Then don’t worry you just have to expand the column to display it properly. Basically the column width is too tight to display the date with format selected that is why it resulted in hash-tags.
Following are some of the combinations I made using the above codes:
|Original format||Code||Desired format|
|8/6/1986||mmmm dd, yyyy||August 06, 1986|
|8/6/1986||“[“mmm”]” dd – yyyy||[Aug] 06 – 1986|
|8/6/1986||mm (dd) yy||08 (06) 86|
|8/6/1986||mmm, dddd, yy||Aug, Wednesday, 86|
So today we learnt how to have a perfect date with dates!
If you like this tutorial then don’t forget to checkout the following tutorials as well:
- Using Excel Custom Number Formatting as Data Validation Tool
- Custom Data Labels with Colors and Symbols in Excel Charts – [How To]
- Dealing with Telephone numbers in Excel – Dialing in the correct format
- Formatting Numbers in Excel – Conditional Formatting Vs Custom Number Formatting
- Changing numbers Sign in Excel – From Negative to Positive and Vice versa