Go Back

Get day from date

Most of the times there is a need to get the day from a given date and there are several options of doing this based on your requirements. There is a built-in function in Excel called the DAY function which is used to get a day from the date. This function returns the numbers 1-31 (date) when supplied with a date.

Syntax

=DAY(date)

Parameter

date–  Includes numbers from 1 to 31 (valid date) in a serial number format.

How does the formula work?

  1. The DAY function has the date parameter which should be a valid date between 1 to 31 and these values are returned as the function of the date.
  2. For example, if the date says 2/12/2006 (Note that the date must be in a format that the Excel spreadsheet recognizes). Here in the example, the day is ‘12’. The DAY function takes just one parameter which is the date for which the day value needs to be extracted. Therefore, this function returns number 12 which is the day component of the date specified.

Note on usage

  1. You can also enter the date as a text using doubles quotes, for example, =DAY(“2/12/2017”). But this can sometimes produce unpredictable results because different computers use different regional date settings. So, it is always better to supply the (cell number) address of the cell containing the date (valid).
  2. One can use the DAY function into other functions such as the DATE function to input a day value.

Example

Let us see different examples to get a day from the date as shown in the results given below.

Figure 1. Using the DAY function to get the day from the date.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

Trying to count and chart how many inventory lots were available on any given date. Question Example: For 9/1/2013 - how many lots were available? Each lot has a "Release Date" and "Expiration Date" and is "Available" every day from the "Release Date" to and including the "Expiration Date". Example: 134530-001 was available every day from 8/8/2013 (day after the "Release Date) and 8/18/2013. Data available is: Lot number (Column A), release date (Column B), expiration date (Column C).
Solved by C. J. in 16 mins
My invoice number codes are made from using the date. For instance the first invoice for today would be 20180326001 (yyyymmdd001), the second today would be 20180326002 (yyyymmdd002). I am trying to get these codes to generate automatically from Excel when I enter the date I create the invoice... for instance I date each invoice the day I create it: 26/03/18, is there a way to generate an invoice code from the date?
Solved by A. W. in 25 mins
I want to work out the years and days from a previous date (day of registration) to current date or a specified date in the future
Solved by I. D. in 12 mins

Leave a Comment

avatar