DAY Function – Get Day Number – Excel, VBA, Google Sheets

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on November 6, 2023
Download Example Workbook

Download the example workbook

This tutorial demonstrates how to use the Excel DAY Function in Excel to get the day of the month.
DAY Main Function

DAY Examples

The DAY Function returns the day number of a date:

=DAY(B3)

DAY

Day Number of Year

To calculate the day number of the year, subtract the first day of the year from your desired date. Do this by using the DATE and YEAR Functions:

=B3-DATE(YEAR(B3),1,1)+1

Day Year to date

DAY and MONTH Functions

Using the DATE and DAY Functions you can build a new date using the same day number as the original date:

=DATE(2021,1,DAY(B3))

Day Date

DAY in Google Sheets

The DAY Function works exactly the same in Google Sheets as in Excel:

DAY google sheet

 

DAY Examples in VBA

You can also use the DAY function in VBA. Type:

application.worksheetfunction.day(serial_number)

For the function arguments (serial_number, etc.), you can either enter them directly into the function, or define variables to use instead.

AI Formula Generator

Try for Free

Excel Practice Worksheet

practice excel worksheet

Practice Excel functions and formulas with our 100% free practice worksheets!

  • Automatically Graded Exercises
  • Learn Excel, Inside Excel!

Free Download

Return to List of Excel Functions