Subscribe for New Post Notifications

Techworld

How to use the DAY function in Microsoft Excel

Let's look at some Excel Day function examples and explore how to use the Day function as a worksheet function in Microsoft Excel:

DAY function

Summary

The Excel DAY function returns the day of the month as a number between 1 to 31 from a given date. You can use the DAY function to extract a day number from a date into a cell.
You can also use the DAY function to extract and feed a day value into another function, like the DATE function.
The DAY function is a built-in function in Excel that is categorized as a Date/Time Function.

Purpose

Get the day as a number from a date.

Return value

A number between 1 and 31.

What Does It Do ?

This function extracts the day of the month from a complete date.

Syntax

Day function has two syntax and hence they can be written in Three different ways:

=DAY(serial_number) or
=DAY (“date”) or
=DAY (cell reference)

Parameters or Arguments

Serial_number: A valid date as per the excel date serial numbers.
Date: The date of the day you are trying to find.
Cell reference: Reference to cells containing dates.

Formatting

Normally the result will be a number, but this can be formatted to show the actual day of the week by using Format,Cells,Number,Custom and using the code ddd or dddd.

Usage notes

The DAY function returns the day value in a given date as a number between 1 to 31 from a given date. For example:

=DAY("15-Jun-2015") || Result: 15

With the date October 01, 2000 in cell B5:

=DAY(B5) || Result: 1

You can use the DAY function to extract a day number from a date into a cell, or to feed a day number into another function like the DATE function.

Note: dates are serial numbers in Excel, and begin on January 1, 1900. Dates before 1900 are not supported. To display date values in a human-readable date format, apply a the number format of your choice.

Notes:

  • Date must be a valid Excel date.
  • For the DAY formula to work correctly, a date should be entered by using the DATE(year, month, day) function.
  • If you attempt to input dates as text, there is a risk that Excel may misinterpret them, due to different date systems, or date interpretation settings on your computer.
  • The input date must be a valid Excel date. The dates in Excel are stored as serial numbers. For example, the date Jan 1, 2010, is equal to the serial number 40179 in Excel. DAY Formula in Excel takes as input both the date directly or the serial number of the date. It is to be noted here that Excel does not recognize dates earlier than 1/1/1900.
  • If you mention an invalid date it will return #VALUE! error.
  • If you skip entering any value in serial_number it will return 0.

Excel Day Function Examples

The following spreadsheet shows two simple examples of the Excel Day function:

DAY Function

The above examples show that each argument to the Day function can be supplied as a single value or cell reference, or as an array of values or cells.

No comments:

Post a Comment