Day numbers in excel

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel for Mac 2011 More…Less

This article describes the formula syntax and usage of the DAYS function in Microsoft Excel. For information about the DAY function, see DAY function.

Description

Returns the number of days between two dates.

Syntax

DAYS(end_date, start_date)

The DAYS function syntax has the following arguments.

  • End_date    Required. Start_date and End_date are the two dates between which you want to know the number of days.

  • Start_date   
    Required. Start_date and End_date are the two dates between which you want to know the number of days.

Note: Excel stores dates as sequential serial numbers so that they can be used in calculations. By default, Jan 1, 1900 is serial number 1, and January 1, 2008 is serial number 39448 because it is 39447 days after January 1, 1900.

Remarks

  • If both date arguments are numbers, DAYS uses EndDate–StartDate to calculate the number of days in between both dates.

  • If either one of the date arguments is text, that argument is treated as DATEVALUE(date_text) and returns an integer date instead of a time component.

  • If date arguments are numeric values that fall outside the range of valid dates, DAYS returns the #NUM! error value.

  • If date arguments are strings that cannot be parsed as valid dates, DAYS returns the #VALUE! error value.

Example

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Data

31-DEC-2021

1-JAN-2021

Formula

Description

Result

=DAYS(«15-MAR-2021″,»1-FEB-2021»)

Finds the number of days between the end date (15-MAR-2021) and start date (1-FEB-2021). When you enter a date directly in the function, you need to enclose it in quotation marks. Result is 42.

42

=DAYS(A2,A3)

Finds the number of days between the end date in A2 and the start date in A3 (364).

364

Top of Page

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Функция DAY (ДЕНЬ) используется в Excel, для того чтобы узнать порядковый номер дня месяца (в промежутке от 1 до 31) из любой даты.

Содержание

  1. Что функция возвращает
  2. Синтаксис
  3. Аргументы функции DAY (ДЕНЬ) в Excel
  4. Дополнительная информация
  5. Примеры использования функции DAY (ДЕНЬ) в Excel
  6. Пример №1. Получаем значение дня используя числовой аргумент
  7. Пример №2. Получаем значение дня из ячейки с датой
  8. Пример №3. Получаем значение дня текущей даты
  9. Пример №4. Получаем значение первого дня месяца

Что функция возвращает

Возвращает число в промежутке от 0 до 31, в зависимости от даты, из которой требуется извлечь данные. Например, возвращая данные для Февраля, формула вернет номер дня в промежутке от «0» до «29».

Синтаксис

=DAY(serial_number)

=ДЕНЬ(дата_в_числовом_формате)

Аргументы функции DAY (ДЕНЬ) в Excel

  • serial_number (дата_в_числовом_формате): Это порядковый номер дня. Он может быть результатом вычисления формулы, ссылкой на ячейку, которая содержит дату или данные введенные вручную.

Дополнительная информация

Помимо введенных в ручную чисел, функция DAY (ДЕНЬ) также будет работать с:

  • результатами вычислений;
  • датой введенной в текстовом формате (в кавычках);
  • датой, указанной в текстовом формате;
  • Excel отразит любую дату начиная с 1 Января 1900 года на Windows и с 1904 года на Mac.

Примеры использования функции DAY (ДЕНЬ) в Excel

Пример №1. Получаем значение дня используя числовой аргумент

Функция DAY (ДЕНЬ) в Excel

На примере выше в качестве аргумента мы используем число “42736”. Это порядковый номер даты “1 января 2017”. Так как 1 января это первый день месяца, то результатом вычисления будет “1”.

Пример №2. Получаем значение дня из ячейки с датой

Функция DAY (ДЕНЬ) в Excel

Telegram Logo Больше лайфхаков в нашем Telegram Подписаться

На примере выше, функция принимает значение ячейки с конкретной датой и возвращает номер дня месяца этой даты. Обратите внимание, что если вы используете формат даты, который не распознается Excel, он покажет ошибку.

Пример №3. Получаем значение дня текущей даты

Вы можете легко получить текущее значение дня с помощью функции TODAY (СЕГОДНЯ) в качестве исходных данных. Функция TODAY (СЕГОДНЯ) возвращает текущую дату, а DAY (ДЕНЬ), в свою очередь, использует эти данные, чтобы вернуть порядковый номер дня этого месяца.

Функция DAY (ДЕНЬ) в Excel

На примере выше, функция TODAY(СЕГОДНЯ) возвращает 12-02-2017. Функция DAY (ДЕНЬ) принимает значение функции TODAY (СЕГОДНЯ) как вводные данные и возвращает значение “12” как порядковый номер дня этого месяца.

Пример №4. Получаем значение первого дня месяца

Вы также можете вычислить значение первого дня любого месяца.

Функция DAY (ДЕНЬ) в Excel

На примере выше, значение дня для даты в ячейке “A2” — “15-03-2017” равно “15”. Для того чтобы узнать номер первого дня месяца этой даты, нам нужно вычесть из нее значение дня (получим “0”, т.к. все даты хранятся в Excel как порядковые номера) и прибавить “1”, чтобы получить первый день месяца.

Обратите внимание, что даты в ячейках D2 и D3 отформатированы как даты. Может случиться так, что, когда вы используете эту формулу, вы можете получить серийный номер (например, “42795” за 1 марта 2017 года). Затем вы можете просто отформатировать его в качестве даты.

Date yes Add (Subtract) Days to a Date Concatenate Dates Convert Date to Number Convert Date to Text Month Name to Number Create Date Range from Dates Day Number of Year Month Name from Date First Day of Month Add (Subtract) Weeks to a Date If Functions with Dates Max Date Number of Days Between Dates Number of Days in a Month Number of Weeks Between Dates Number of Years Between Dates Split Date & Time into Separate Cells Countdown Remaining Days Insert Dates Random Date Generator Using Dynamic Ranges — Year to Date Values Add (Subtract) Years to a Date Date Formula Examples Extract Day from Date Get Day Name from Date Count Days Left in Month / Year Count Workdays Left in Month / Year Get Last Day of Month Last Business Day of Month / Year Number of Work / Business Days in Month Weekday Abbreviations Auto Populate Dates Number of Months Between Dates Quarter from a Date Years of Service Change Date Format Compare Dates Time yes Add (Subtract) Hours to Time Add (Subtract) Minutes to Time Add (Subtract) Seconds to Time Add Up time (Total Time) Time Differences Change Time Format Convert Minutes to Hours Convert Time to Decimal Convert Time to Hours Convert Time to Minutes Convert Time to Seconds Military Time Round Time to Nearest 15 Minutes Overtime Calculator Number of Hours Between Times Convert Seconds to Minutes, Hours, or Time Count Hours Worked Time Differences Time Format — Show Minutes Seconds Text yes Add Commas to Cells Get First Word from Text Capitalize First Letter Clean & Format Phone #s Remove Extra Trailing / Leading Spaces Add Spaces to Cell Assign Number Value to Text Combine Cells with Comma Combine First and Last Names Convert Text String to Date Convert Text to Number Extract Text From Cell Get Last Word Remove Unwated Characters Extract Text Before or After Character How to Split Text String by Space, Comma, & More Remove Special Characters Remove First Characters from Left Substitute Multiple Values Switch First & Last Names w/ Commas Remove Specific Text from a Cell Extract Text Between Characters (Ex. Parenthesis) Add Leading Zeros to a Number Remove Line Breaks from Text Remove all Numbers from Text Reverse Text Remove Non-Numeric Characters Remove Last Character(s) From Right Separate First and Last Names Separate Text & Numbers Round yes Round Formulas Round Price to Nearest Dollar or Cent Round to Nearest 10, 100, or 1000 Round to Nearest 5 or .5 Round Percentages Round to Significant Figures Count yes Count Blank and Non-blank Cells Count Cells Between Two Numbers Count Cells not Equal to Count if Cells are in Range Count Times Word Appears in Cell Count Words in Cell Count Specific Characters in Column Count Total Number of Characters in Column Count Cells that Equal one of two Results Count Cells that do not Contain Count Cells that Contain Specific Text Count Unique Values in Range Countif — Multiple Criteria Count Total Number of Cells in Range Count Cells with Any Text Count Total Cells in a Table Lookup yes Two Dimensional VLOOKUP VLOOKUP Simple Example Vlookup — Multiple Matches Case Sensitive Lookup Case Sensitive VLOOKUP Sum if — VLOOKUP Case Sensitive Lookup Case Sensitive VLOOKUP Find Duplicates w/ VLOOKUP or MATCH INDEX MATCH MATCH Lookup — Return Cell Address (Not Value) Lookup Last Value in Column or Row Reverse VLOOKUP (Right to Left) Risk Score Bucket with VLOOKUP Sum with a VLOOKUP Function VLOOKUP & INDIRECT VLOOKUP Concatenate VLOOKUP Contains (Partial Match) 17 Reasons Why Your XLOOKUP is Not Working Double (Nested) XLOOKUP — Dynamic Columns IFERROR (& IFNA) XLOOKUP Lookup Min / Max Value Nested VLOOKUP Top 11 Alternatives to VLOOKUP (Updated 2022!) VLOOKUP – Dynamic Column Reference VLOOKUP – Fix #N/A Error VLOOKUP – Multiple Sheets at Once VLOOKUP & HLOOKUP Combined VLOOKUP & MATCH Combined VLOOKUP Between Worksheets or Spreadsheets VLOOKUP Duplicate Values VLOOKUP Letter Grades VLOOKUP Return Multiple Columns VLOOKUP Returns 0? Return Blank Instead VLOOKUP w/o #N/A Error XLOOKUP Multiple Sheets at Once XLOOKUP Between Worksheets or Spreadsheets XLOOKUP by Date XLOOKUP Duplicate Values XLOOKUP Multiple Criteria XLOOKUP Return Multiple Columns XLOOKUP Returns 0? Return Blank Instead XLOOKUP Text XLOOKUP with IF XLOOKUP With If Statement Misc. yes Sort Multiple Columns Use Cell Value in Formula Percentage Change Between Numbers Percentage Breakdown Rank Values Add Spaces to Cell CAGR Formula Average Time Decimal Part of Number Integer Part of a Number Compare Items in a List Dealing with NA() Errors Get Worksheet Name Wildcard Characters Hyperlink to Current Folder Compound Interest Formula Percentage Increase Create Random Groups Sort with the Small and Large Functions Non-volatile Function Alternatives Decrease a Number by a Percentage Calculate Percent Variance Profit Margin Calculator Convert Column Number to Letter Get Full Address of Named Range Insert File Name Insert Path Latitute / Longitude Functions Replace Negative Values Reverse List Range Convert State Name to Abbreviation Create Dynamic Hyperlinks Custom Sort List with Formula Data Validation — Custom Formulas Dynamic Sheet Reference (INDIRECT) Reference Cell in Another Sheet or Workbook Get Cell Value by Address Get Worksheet Name Increment Cell Reference List Sheet Names List Skipped Numbers in Sequence Return Address of Max Value in Range Search by Keywords Select Every Other (or Every nth) Row Basics yes Cell Reference Basics — A1, R1C1, 3d, etc. Add Up (Sum) Entire Column or Row Into to Dynamic Array Formulas Conversions yes Convert Time Zones Convert Celsius to Fahrenheit Convert Pounds to Kilograms Convert Time to Unix Time Convert Feet to Meters Convert Centimeters to Inches Convert Kilometers to Miles Convert Inches to Feet Convert Date to Julian Format Convert Column Letter to Number Tests yes Test if a Range Contains any Text Test if any Cell in Range is Number Test if a Cell Contains a Specific Value Test if Cell Contains Any Number Test if Cell Contains Specific Number Test if Cell is Number or Text If yes Percentile If Subtotal If Sumproduct If Large If and Small If Median If Concatentate If Max If Rank If TEXTJOIN If Sum yes Sum if — Begins With / Ends With Sum if — Month or Year to Date Sum if — By Year Sum if — Blank / Non-Blank Sum if — Horizontal Sum Count / Sum If — Cell Color INDIRECT Sum Sum If — Across Multiple Sheets Sum If — By Month Sum If — Cells Not Equal To Sum If — Not Blank Sum if — Between Values Sum If — Week Number Sum Text Sum if — By Category or Group Sum if — Cell Contains Specific Text (Wildcards) Sum if — Date Rnage Sum if — Dates Equal Sum if — Day of Week Sum if — Greater Than Sum if — Less Than Average yes Average Non-Zero Values Average If — Not Blank Average — Ignore 0 Average — Ignore Errors Math yes Multiplication Table Cube Roots nth Roots Square Numbers Square Roots Calculations yes Calculate a Ratio Calculate Age KILLLLLLL Calculate Loan Payments GPA Formula Calculate VAT Tax How to Grade Formulas Find yes Find a Number in a Column / Workbook Find Most Frequent Numbers Find Smallest n Values Find nth Occurance of Character in Text Find and Extract Number from String Find Earliest or Latest Date Based on Criteria Find First Cell with Any Value Find Last Row Find Last Row with Data Find Missing Values Find Largest n Values Most Frequent Number Conditional Formatting yes Conditional Format — Dates & Times Conditional Format — Highlight Blank Cells New Functions XLOOKUP Replaces VLOOKUP, HLOOKUP, and INDEX / MATCH Logical yes AND Checks whether all conditions are met. TRUE/FALSE IF If condition is met, do something, if not, do something else. IFERROR If result is an error then do something else. NOT Changes TRUE to FALSE and FALSE to TRUE. OR Checks whether any conditions are met. TRUE/FALSE XOR Checks whether one and only one condition is met. TRUE/FALSE Lookup & Reference yes FALSE The logical value: FALSE. TRUE The logical value: TRUE. ADDRESS Returns a cell address as text. AREAS Returns the number of areas in a reference. CHOOSE Chooses a value from a list based on it’s position number. COLUMN Returns the column number of a cell reference. COLUMNS Returns the number of columns in an array. HLOOKUP Lookup a value in the first row and return a value. HYPERLINK Creates a clickable link. INDEX Returns a value based on it’s column and row numbers. INDIRECT Creates a cell reference from text. LOOKUP Looks up values either horizontally or vertically. MATCH Searches for a value in a list and returns its position. OFFSET Creates a reference offset from a starting point. ROW Returns the row number of a cell reference. ROWS Returns the number of rows in an array. TRANSPOSE Flips the oriention of a range of cells. VLOOKUP Lookup a value in the first column and return a value. Date & Time yes DATE Returns a date from year, month, and day. DATEDIF Number of days, months or years between two dates. DATEVALUE Converts a date stored as text into a valid date DAY Returns the day as a number (1-31). DAYS Returns the number of days between two dates. DAYS360 Returns days between 2 dates in a 360 day year. EDATE Returns a date, n months away from a start date. EOMONTH Returns the last day of the month, n months away date. HOUR Returns the hour as a number (0-23). MINUTE Returns the minute as a number (0-59). MONTH Returns the month as a number (1-12). NETWORKDAYS Number of working days between 2 dates. NETWORKDAYS.INTL Working days between 2 dates, custom weekends. NOW Returns the current date and time. SECOND Returns the second as a number (0-59) TIME Returns the time from a hour, minute, and second. TIMEVALUE Converts a time stored as text into a valid time. TODAY Returns the current date. WEEKDAY Returns the day of the week as a number (1-7). WEEKNUM Returns the week number in a year (1-52). WORKDAY The date n working days from a date. WORKDAY.INTL The date n working days from a date, custom weekends. YEAR Returns the year. YEARFRAC Returns the fraction of a year between 2 dates. Engineering yes CONVERT Convert number from one unit to another. Financial yes FV Calculates the future value. PV Calculates the present value. NPER Calculates the total number of payment periods. PMT Calculates the payment amount. RATE Calculates the interest Rate. NPV Calculates the net present value. IRR The internal rate of return for a set of periodic CFs. XIRR The internal rate of return for a set of non-periodic CFs. PRICE Calculates the price of a bond. YIELD Calculates the bond yield. INTRATE The interest rate of a fully invested security. Information yes CELL Returns information about a cell. ERROR.TYPE Returns a value representing the cell error. ISBLANK Test if cell is blank. TRUE/FALSE ISERR Test if cell value is an error, ignores #N/A. TRUE/FALSE ISERROR Test if cell value is an error. TRUE/FALSE ISEVEN Test if cell value is even. TRUE/FALSE ISFORMULA Test if cell is a formula. TRUE/FALSE ISLOGICAL Test if cell is logical (TRUE or FALSE). TRUE/FALSE ISNA Test if cell value is #N/A. TRUE/FALSE ISNONTEXT Test if cell is not text (blank cells are not text). TRUE/FALSE ISNUMBER Test if cell is a number. TRUE/FALSE ISODD Test if cell value is odd. TRUE/FALSE ISREF Test if cell value is a reference. TRUE/FALSE ISTEXT Test if cell is text. TRUE/FALSE N Converts a value to a number. NA Returns the error: #N/A. TYPE Returns the type of value in a cell. Math yes ABS Calculates the absolute value of a number. AGGREGATE Define and perform calculations for a database or a list. CEILING Rounds a number up, to the nearest specified multiple. COS Returns the cosine of an angle. DEGREES Converts radians to degrees. DSUM Sums database records that meet certain criteria. EVEN Rounds to the nearest even integer. EXP Calculates the exponential value for a given number. FACT Returns the factorial. FLOOR Rounds a number down, to the nearest specified multiple. GCD Returns the greatest common divisor. INT Rounds a number down to the nearest integer. LCM Returns the least common multiple. LN Returns the natural logarithm of a number. LOG Returns the logarithm of a number to a specified base. LOG10 Returns the base-10 logarithm of a number. MOD Returns the remainder after dividing. MROUND Rounds a number to a specified multiple. ODD Rounds to the nearest odd integer. PI The value of PI. POWER Calculates a number raised to a power. PRODUCT Multiplies an array of numbers. QUOTIENT Returns the integer result of division. RADIANS Converts an angle into radians. RAND Calculates a random number between 0 and 1. RANDBETWEEN Calculates a random number between two numbers. ROUND Rounds a number to a specified number of digits. ROUNDDOWN Rounds a number down (towards zero). ROUNDUP Rounds a number up (away from zero). SIGN Returns the sign of a number. SIN Returns the sine of an angle. SQRT Calculates the square root of a number. SUBTOTAL Returns a summary statistic for a series of data. SUM Adds numbers together. SUMIF Sums numbers that meet a criteria. SUMIFS Sums numbers that meet multiple criteria. SUMPRODUCT Multiplies arrays of numbers and sums the resultant array. TAN Returns the tangent of an angle. TRUNC Truncates a number to a specific number of digits. Stats yes AVERAGE Averages numbers. AVERAGEA Averages numbers. Includes text & FALSE =0, TRUE =1. AVERAGEIF Averages numbers that meet a criteria. AVERAGEIFS Averages numbers that meet multiple criteria. CORREL Calculates the correlation of two series. COUNT Counts cells that contain a number. COUNTA Count cells that are non-blank. COUNTBLANK Counts cells that are blank. COUNTIF Counts cells that meet a criteria. COUNTIFS Counts cells that meet multiple criteria. FORECAST Predict future y-values from linear trend line. FREQUENCY Counts values that fall within specified ranges. GROWTH Calculates Y values based on exponential growth. INTERCEPT Calculates the Y intercept for a best-fit line. LARGE Returns the kth largest value. LINEST Returns statistics about a trendline. MAX Returns the largest number. MEDIAN Returns the median number. MIN Returns the smallest number. MODE Returns the most common number. PERCENTILE Returns the kth percentile. PERCENTILE.INC Returns the kth percentile. Where k is inclusive. PERCENTILE.EXC Returns the kth percentile. Where k is exclusive. QUARTILE Returns the specified quartile value. QUARTILE.INC Returns the specified quartile value. Inclusive. QUARTILE.EXC Returns the specified quartile value. Exclusive. RANK Rank of a number within a series. RANK.AVG Rank of a number within a series. Averages. RANK.EQ Rank of a number within a series. Top Rank. SLOPE Calculates the slope from linear regression. SMALL Returns the kth smallest value. STDEV Calculates the standard deviation. STDEV.P Calculates the SD of an entire population. STDEV.S Calculates the SD of a sample. STDEVP Calculates the SD of an entire population TREND Calculates Y values based on a trendline. Text yes CHAR Returns a character specified by a code. CLEAN Removes all non-printable characters. CODE Returns the numeric code for a character. CONCATENATE Combines text together. DOLLAR Converts a number to text in currency format. EXACT Test if cells are exactly equal. Case-sensitive. TRUE/FALSE FIND Locates position of text within a cell.Case-sensitive. LEFT Truncates text a number of characters from the left. LEN Counts number of characters in text. LOWER Converts text to lower case. MID Extracts text from the middle of a cell. PROPER Converts text to proper case. REPLACE Replaces text based on it’s location. REPT Repeats text a number of times. RIGHT Truncates text a number of characters from the right. SEARCH Locates position of text within a cell.Not Case-sensitive. SUBSTITUTE Finds and replaces text. Case-sensitive. TEXT Converts a value into text with a specific number format. TRIM Removes all extra spaces from text. UPPER Converts text to upper case. VALUE Converts a number stored as text into a number.

DAY Function in Excel

DAY in Excel

The Day function in Excel looks at a given date and figures out what day of the month it is. It then gives you a number from 1 to 31, representing the day. For example, if you have a date “April 16, 2023” in cell B1 and use the formula =DAY (B1), you will get the result as 16.

Excel has categorized the DAY function under the Date/Time function, a built-in function in Excel.

DAY Formula in Excel

The formula/syntax is:

DAY Formula

where,
Date_value/serial_number – You must enter an Excel date with a serial number format.

To access the Day function in Excel:
1. Click on the Formulas
2. Select the ‘Date & Time’ option.

DAY Formula in Excel- Date and Time

3. Select the DAY function from the drop-down list.

DAY Formula in Excel- Date and Time-Day

How to Use DAY Function in Excel?

Example #1

Let’s say you have a list of dates in column A and want to extract only the day in another column, say column C.

Example 1

Here are the steps:

1. First, download the DAY Function Template. This template has all examples used in this article.

You can download this DAY Function Excel Template here – DAY Function Excel Template

2. In cell C5, type the formula “=DAY(A5)” and press enter.

Eg1 st2

3. This will extract the day (28)  from the date.

Eg1 st3

4. Drag and drop the formula from cell C5 to the remaining cells in column C to get the day for all the dates in column A.
5. Your result will be displayed in column C.

Eg1 st5

Example #2

Suppose we have the below dates, and we need to add a given number of years to these dates. Let us use the DAY function to accomplish this:

Eg2

We will enter this formula in cell C13: =DATE(YEAR(A13)+B13,MONTH(A13),DAY(A13))

Eg2-2

The formula provides the result as shown in the image below:

Eg2-3

Drag & drop this formula to the remaining cells, and it gives the below result:

Eg2-4

Explanation:

  • The functions- YEAR, MONTH, and DAY that we used in the above formula retrieve the below data components:

For cell A13,
Year= 2019
Month= 3 (March)
Date= 16

Example #3

Suppose we want to find the first day of the month on a given date. For this, we will use the DAY function.

Eg3

We will enter this formula in cell C24: =A24-DAY(A24)+1

Eg3-2

Excel provides the result as shown in the image below:

Eg3-3

Drag & drop this formula for the rest values, and Excel provides the below result:

Eg3-4

Explanation:

  • The DAY function returns the day value for a date. The day value for the date 11/23/2020(cell A24) is 23.
  • Excel stores the dates as serial numbers. So, we can subtract the value of 23 and then add 1 to obtain the date value for 11/01/2020.

Example #4

We can calculate the number of days for a month on a given date with the help of the DAY function.

Eg4

We will this formula: =DAY(EOMONTH(A36,0))

Eg4-2

Eg4-3

Drag & drop the formula to the remaining cells, which gives the results shown below:

DAY in Excel-Eg4-4

Common Errors and Fixes for Day in Excel

  • #VALUE! – Excel gives a value error if we provide a date in the incorrect format, as shown below

Common Errors and Fixes for Day in Excel

To fix this error, follow these steps,

Step 1: Right-click the date, and choose Format Cells in the context menu
A Format Cells window pops up,

Step 2: Under the Format cells window, click Date under the Number tab, choose the desired date format from the list under the Type section, and click OK.
The entire process is illustrated in the image below.

DAY in Excel-Common Errors Step 2

Things to Remember

  • The date argument must be a valid Excel date.
  • Sometimes the DAY function provides a date- 01/01/1900, which looks like a date, while it needs to be an integer.
  • To fix the above issue, go to the Number group in the Home tab and select Number from the various options. The process is illustrated in the following image.

Things to Remember 1

In the below image, select the Number option under General Option.

DAY in Excel-Things to Remember 2

Frequently Asked Questions (FAQs)

Q1. How do I use the day formula in Google Sheets?
Answer: To use the day formula in Google Sheets, follow these steps:
Step 1: Place the cursor in the cell where you want to display the Day and enter the formula =DAY(date)
Step 2: Hit Enter key to get the result

Q1 step 2

Alternatively,
You can insert the Day function by following these steps:
Insert > Function > Date > Day

DAY in Excel-Q1 step2-2

Q2. How do I add a day in Google Sheets?                                     
Answer: To add a given number of days to a date in Google Sheets, perform an addition of the two cells, i.e., use the formula = date + number of days.

DAY in Excel-Q2

Recommended Articles

The above article has been a guide to DAY in Excel. Here we discuss the DAY function in Excel and the way of using the DAY function along with downloadable Excel templates. EDUCBA recommends the following useful functions in Excel –

  1. $ in Excel
  2. Excel Search Box
  3. HLOOKUP in Excel
  4. VLOOKUP Function in EXCEL

Sample Files

1. DATE Function

DATE function returns a valid date based on the day, month, and year you input. In simple words, you need to specify all the components of the date and it will create a date out of that.

Syntax

DATE(year,month,day)

Arguments

  • year: A number to use as the year.
  • month: A number to use as the month.
  • day: A number to use as a day.

Example

In the below example, we have used cell references to specify the year, month, and day to create a date.

You can also insert arguments directly into the function to create a date as you can see in the below example.

And in the below example, we have used different types of arguments to see the result returned by the function.

2. DATEVALUE Function

DATEVALUE function returns a date after converting a text (which represents a date) into an actual date. In simple words, it converts a date into an actual date which is formatted as text.

Syntax

DATEVAUE(date_text)

Arguments

  • date_text: The date which is stored as a text and you want to convert that text into an actual date.

Example

In the below example, we have inserted a date directly into the function by using double quotation marks. If you skip adding these quotation marks it will return a #NAME? error in the result.

excel-datevalue-function-example-1

In the below example, all the dates on the left side are in textual format.

  1. A simple textual date that we have converted into a valid date.
  2. A date with all three components (Year, Month, or Day) in numbers.
  3. If there is no year in the textual date, it will take the current year as the year.
  4. And if you have a month name is in alphabets and no year, it will take the current year as a year.
  5. If you don’t have the day in your textual date it will take 1 as the day number.
excel-datevalue-function-example-2

3. DAY Function

DAY function returns the day number from a valid date. As you know, in Excel, a date is a combination of day, month, and year, DAY function gets the day from the date and ignores the rest of the part.

Syntax

DAY(serial_number)

Arguments

  • serial_number: A valid serial number of the date from which you want to extract the day number.

Example

In the below example, we have used the DAY to simply get the day from a date.

excel-day-function-example-1

And in the below example, we have used DAY with TODAY to create a dynamic formula that returns the current day number and it will update every time you open your worksheet or when you recalculate your worksheet.

excel-day-function-example-2

5. DAYS Function

DAYS function returns the difference between two dates. It takes a start date and an end date and then returns the difference between them in days. This function was introduced in Excel 2013 so not available in prior versions.

Syntax

DAYS(end_date,start_date)

Arguments

  • start_date: It is a valid date from where you want to start the days’ calculation.
  • end_date: It is a valid date from where you want to end the days’ calculation.

Example

In the below example, we have referred the cell A1 as the start date and B1 as the end date and we have 9 days in the result.

Note: You can also use the subtract operator to get the difference between two dates.

excel-days-function-example-1

In the below example, we have directly inserted two dates into the function to get the difference between them.

excel-days-function-example-2

6. EDATE Function

EDATE function returns a date after adding a specified number of months to it. In simple words, you can add (with a positive number) or subtract (with a negative number) months from a date.

Syntax

EDATE(start_date,months)

Arguments

  • start_date: The date from which you want to start the calculation.
  • months: The number of months to calculate the future or the past date.

Example

Here we have used EDATE with different types of arguments.

  • In the first example, we have used 5 as a several months and it has added exactly 5 months on 1-Jan-2016 and returned 01-June-2016.
  • In the second example, we have used -1 month and it has given 31-Dec-2016, a date which is exactly 1 month back from 31-Jan-2016.
  • In the third example, we have inserted a date directly into the function.
excel-edate-function-example-1

7. EOMONTH Function

EOMONTH function returns the end of the month date which is the number of months in the future or the past. You can use a positive number for a future date and a negative number for the past month’s date.

Syntax

EOMONTH(start_date,months)

Arguments

  • start_date: A valid date from where you want to start your calculation.
  • months: The number of months you want to calculate before and after the start date.

Example

In the below example, we have used EOMONTH with different types of arguments:

excel-emonth-function-example-1
  • We have mentioned 01-Jan-2016 as the start date and 5 months for getting a future date. As June is exactly 5 months after January, it has returned 30-Jun-2016 in the result.
  • As I have already mentioned, EOMMONTH is smart enough to evaluate the total number of days in a month.
  • If you mention a negative number, it simply returns a past date which is the number of months back you have mentioned.
  • In the fourth example, we have used a date that is in text format and it has returned the date without returning any errors.

8. MONTH Function

MONTH function returns the month number (ranging from 0 to 12) from a valid date. As you know, in Excel, a date is a combination of day, month, and year, MONTH gets the month from the date and ignores the rest of the part.

Syntax

MONTH(serial_number)

Arguments

  • serial_number: A valid date from which you want to get the month number.

Example

In the below example, we have used a MONTH in three different ways:

excel-month-function-example-1
  • In the FIRST example, we have simply used date and it has returned the 5 in the result which is the month number of MAY.
  • In the SECOND example, we have supplied the date directly in the function.
  • In the THIRD example, we have used the TODAY function to get the current date and MONTH has returned the month number from it.

9. NETWORKDAYS Function

NETWORKDAYS function returns the count of days between the start date and end date. In simple words, with NETWORKDAYS you can calculate the difference between two dates, after excluding Saturdays and Sundays, and holidays (which you specify).

Syntax

NETWORKDAYS(start_date,end_date,holidays)

Arguments

  • start_date: A valid date from where you want to start your calculation.
  • end_date: A valid date up to which you want to calculate working days.
  • [holidays]: A valid date that represents a holiday between the start date and end date. You can refer to a cell, range of cells, or an array containing dates.

Example

In the below example, we have specified 10-Jan-2015 as a start date and 20-Feb-2015 as an end date.

excel-networkdays-function-example-1

We have 41 days between these two dates, out of which 11 days are weekends. After deducting those 11 days it has returned 30 working days.

Now in the below example with the same start and end dates, we have specified a holiday and, after deducting 11 days of the weekend and 1 holiday it has returned 29 working days.

excel-networkdays-function-example-2

Again with the same start and end dates, we have used a range of three cells for holidays to deduct from the calculation and, after deducting 11 weekend days and 3 holidays which I have mentioned It has returned 27 working days.

excel-networkdays-function-example-3

10. NETWORKDAYS.INTL Function

NETWORKDAYS.INTL Function returns the count of days between the start date and end date. Unlike NETWORKDAYS, NETWORKDAYS.INTL lets you specify which days you want to exclude from the calculation.

Syntax

NETWORKDAYS.INTL(start_date,end_date,weekend,holidays)

Arguments

  • start_date: A valid date from where you want to start your calculation.
  • end_date: A valid date up to which you want to calculate working days.
  • [weekend]: A number represents to exclude weekends from the calculation.
  • [holidays]: A list of dates that represents the holidays you want to exclude from the calculation.

Example

In the below example, we have used 01-Jan-2015 as a start date and 20-Jan-2015 as an end date. And we have specified 1 to take Sunday – Saturday as the weekend. The function has returned 14 days after excluding 6 weekend days.

excel-networkdays.intl-function-example-1

Below, we have used the same dates. And I have used 11 in for weekend days which means it will only consider Sunday as a weekend. Along with that, we have also used 10-Jan-2015 as a holiday.

excel-networkdays.intl-function-example-2

We have 3 Sundays between both dates and a holiday. After excluding all these days the function has returned 16 days in the result. Here in the below example, we have used range to specify holidays. If you have more than one date for the holidays you can refer to an entire range.

excel-networkdays.intl-function-example-3

Quick Tip: If you want to create a dynamic range for holidays, you can use a table for that. If you want to choose custom days to count as working days or weekends, you can use the below format in the weekend argument.

excel-networkdays.intl-function-example-4

Here, 0 represents a working day and 1 represents a non-working day. And, seven numbers represent 7 days of the week.

11. TODAY Function

The TODAY function returns the current date and time as per the system’s date and time. The date and time returned by the NOW function update continuously whenever you update anything in the worksheet.

Syntax

TODAY()

Arguments

  • In the TODAY function, there is no argument, all you need to do is enter it in the cell and hit enter, but be careful as TODAY is a volatile function which updates its value every time you update your worksheet calculations.

Example

In the below example, we have used TODAY  with other functions to get the current month number, current year, and current day.

excel-today-function-example-1

12. WEEKDAY Function

WEEKDAY function returns a day number (ranging from 0 to 7) of the week from a date. In simple words, the WEEKDAY function takes a date and returns the day number of that date’s day.

Syntax

WEEKDAY (serial_number, [return_type])

Arguments

  • serial_number: A valid date from which you want to get the week number.
  • [return_type]: A number that represents the day of the week to start the week.

Example

In the below example, we have used a WEEKDAY with TODAY to get a dynamic weekday. It will give you the weekday whenever the current date changes. You can use this method in your dashboards to trigger some values which need to change when weekday change.

excel-weekday-function-example-1

In the below example, we have used WEEKDAY with IF to create a formula that first checks the weekday of date and return “Weekday” or “Weekend” basis on the value return from WEEKDAY.

excel-weekday-function-example-2

13. WEEKNUM Function

WEEKNUM function returns the week number of a date. In simple words, WEEKNUM returns the week number of dates that you specify ranging from 1 to 54.

Syntax

WEEKNUM(serial_number,return_type)

Arguments

  • serial_number: A date for which you want to get the week number.
  • [return_type]: A number to specify the starting day of the first week of the year. You have two systems to specify the starting date of the week.

Example

In the below example, we have used TODAY with WEEKNUM to get the week number of the current date. It will update the week number automatically every time the date changes.

excel-weeknum-function-example-1

In the below example, we have added the text “Week-” with the week number for a meaningful result.

excel-weeknum-function-example-2

14. YEAR Function

YEAR Function returns the year number from a valid date. As you know, in Excel a date is a combination of day, month, and year, and the YEAR function gets the year from the date and ignores the rest of the part.

Syntax

YEAR(date)

Arguments

  • date: A date from which you want to get the year.

Example

In the below example, we have used the year function to get the year number from the dates. You can use this function where you have dates in your data and you only need the year number.

excel-year-function-example-1

And in the below example, we have used today function to get the year number from the current date. It will always update the year whenever you recalculate your worksheet.

excel-year-function-example-2

Понравилась статья? Поделить с друзьями:
  • Day month year to month day year in excel
  • Day month and year in excel
  • Day in words excel
  • Datamatrix код в excel
  • Datagridview vb net and excel