Excel Practice Test

โ–ถ

The days excel function is one of the most underrated time-saving formulas in the entire spreadsheet toolkit, and once you understand how it works, you will wonder how you ever managed deadlines, aging reports, or project timelines without it. At its core, DAYS returns the number of days between two dates, and it does so with a simple two-argument syntax that even spreadsheet beginners can master in about ten minutes of focused practice on real worksheets.

Microsoft introduced DAYS in Excel 2013, and it has since become a staple in finance, accounting, human resources, logistics, and project management workflows across every industry. Unlike the older DATEDIF function, DAYS is fully documented, fully supported, and behaves predictably across Windows, Mac, and Excel for the web. That consistency matters when you are building templates that other people will open on different machines and different Excel versions.

If you have ever struggled with vlookup excel formulas that pull dates from another sheet only to realize you still need to compute the gap between those dates, DAYS is the natural partner. You can nest it inside IF statements, combine it with TODAY for live aging calculations, or wrap it inside SUMPRODUCT to count overdue invoices across an entire ledger without writing a single line of VBA code or building any helper columns.

This guide walks you through the syntax, the most common business use cases, the pitfalls that trip up new users, and the advanced patterns that senior analysts use every day. You will see examples for accounts receivable aging, employee tenure tracking, contract expiration alerts, and project burndown reports. Each example uses real numbers you can copy directly into your own workbook and adapt to your data within minutes, not hours.

By the end of this article, you will know exactly when to use DAYS, when to reach for NETWORKDAYS instead, and how to handle the edge cases that involve negative results, text-formatted dates, and the famous 1900 leap year bug that Excel inherited from Lotus 1-2-3 decades ago. We will also cover error messages like #VALUE! and #NUM! so you can debug formulas the moment something looks wrong on your dashboard or report.

Whether you are a financial analyst calculating days sales outstanding, an HR specialist tracking probation periods, or a project manager monitoring milestone slippage, this guide gives you the practical knowledge to use DAYS with total confidence. Bookmark this page, keep it open in another tab as you work, and treat the examples as a personal reference library that grows more useful every time you return to it for a new spreadsheet challenge.

DAYS Function by the Numbers

๐Ÿ“…
2013
Year Introduced
โšก
2
Required Arguments
๐Ÿ“Š
2,958,465
Max Date Serial
๐Ÿ”ข
1
Minimum Date Serial
๐ŸŒ
100%
Cross-Platform
Try Free Days Excel Function Practice Questions

DAYS Function Syntax and Arguments Explained

๐Ÿ“… end_date Argument

The later date in your calculation. Can be a cell reference, a date typed directly with DATE(2026,5,21), or the result of a function like TODAY or EOMONTH. Must resolve to a valid Excel date serial number between 1 and 2958465.

๐Ÿ—“๏ธ start_date Argument

The earlier date in your calculation. Same rules apply as the end_date. If start_date is later than end_date, DAYS returns a negative integer, which is useful for countdown formulas that show days remaining until a target deadline.

๐Ÿ”ข Return Value

Always a whole number representing the count of calendar days between the two dates. Includes weekends and holidays. Result is positive when end_date is later, negative when start_date is later, and zero when they match exactly on the same calendar day.

โœ๏ธ Basic Formula

=DAYS(end_date, start_date). For example, =DAYS("2026-12-31","2026-01-01") returns 364. The order matters โ€” end_date comes first, opposite of subtraction. Many users confuse this with the older subtraction method that places start_date first in the formula.

Understanding how DAYS works under the hood will save you hours of debugging time when formulas behave unexpectedly. Excel stores every date as a sequential serial number, starting with January 1, 1900 as serial number 1 and incrementing by one for each subsequent day. When you type a date like 5/21/2026 into a cell, Excel quietly converts it to the serial number 46163 and displays it in whatever date format your locale prefers, which can vary between US and European conventions.

The DAYS function takes the two serial numbers, subtracts start_date from end_date, and returns the difference as a whole integer. That is it. No magic, no time zone conversions, no calendar arithmetic. This simplicity is precisely why DAYS is so reliable across versions, platforms, and locales. If you have ever needed to use vlookup excel to pull a date from a lookup table, you can wrap that VLOOKUP directly inside DAYS without any intermediate steps or helper columns to clutter your workbook.

Here is a concrete example. Imagine you have an invoice issued on March 15, 2026 in cell A2 and a payment received date of April 28, 2026 in cell B2. The formula =DAYS(B2,A2) returns 44, telling you the customer took 44 days to pay. That number flows directly into days sales outstanding calculations, aging buckets, and collection performance dashboards that finance teams review every single Monday morning across thousands of companies worldwide.

One subtle behavior worth memorizing is how DAYS handles text-formatted dates. If you pass a string like "2026-05-21" enclosed in double quotes, Excel attempts to parse it using your system locale settings. This usually works on US systems but can fail unpredictably on machines configured for European date formats where day comes before month. The safest practice is always to use the DATE function or direct cell references that contain real date values, never text strings that might be misinterpreted on different computers.

DAYS also gracefully handles dates that include time components. If your end_date cell contains 5/21/2026 3:45 PM and your start_date contains 5/20/2026 8:00 AM, DAYS still returns 1, because it ignores the time portion entirely and looks only at the integer part of the serial number. If you need fractional days that account for hours and minutes, you would simply subtract the cells directly using the minus operator and format the result as a regular number instead.

Negative results are perfectly valid and intentionally supported by the function. If you reverse the arguments accidentally, the formula returns a negative integer rather than throwing an error. Some analysts deliberately exploit this behavior to build countdown formulas where a negative number signals an overdue task and a positive number signals time remaining. Conditional formatting on the sign of the result creates instant visual cues that highlight problems before they grow into bigger issues for the team.

FREE Excel Basic and Advance Questions and Answers
Test your Excel fundamentals with practical questions covering basic and advanced features.
FREE Excel Formulas Questions and Answers
Practice common Excel formula questions including date, lookup, and math functions used daily.

DAYS vs DATEDIF vs NETWORKDAYS: Choosing the Right Function

๐Ÿ“‹ DAYS

DAYS is the modern, officially documented function for calculating calendar day differences. It accepts two arguments, returns a whole integer, and works identically across every Excel version from 2013 forward. The end_date comes first and start_date comes second, which is the opposite of simple subtraction order and trips up many new users during their first week of practice.

Use DAYS when you need a simple, reliable count of total days between two dates, including weekends and holidays. It is ideal for aging reports, contract duration tracking, employee tenure calculations, and any scenario where every calendar day counts equally. Unlike DATEDIF, DAYS has full IntelliSense support and shows up in the formula autocomplete dropdown as soon as you type the letter D in your formula bar.

๐Ÿ“‹ DATEDIF

DATEDIF is an older function inherited from Lotus 1-2-3 that calculates differences in years, months, or days depending on a third unit argument like Y, M, or D. It is undocumented in modern Excel help but still works in every version. The syntax is =DATEDIF(start_date, end_date, unit), with start_date first, which is the opposite of DAYS and causes endless confusion.

Reach for DATEDIF when you need age in years, tenure in completed months, or partial period calculations. It supports six unit codes including YM and MD for remainder months and days. The function does not appear in IntelliSense, so you must type it manually with exact spelling. Microsoft has warned that DATEDIF may behave incorrectly with certain date ranges, so always verify results.

๐Ÿ“‹ NETWORKDAYS

NETWORKDAYS counts only business days between two dates, automatically excluding Saturdays and Sundays. The basic syntax is =NETWORKDAYS(start_date, end_date, [holidays]) with an optional third argument that accepts a range of holiday dates to exclude. This makes it perfect for service level agreement tracking, shipping estimates, and project planning where weekends do not count toward delivery commitments.

Use NETWORKDAYS when weekends and holidays should be excluded from your count. For non-standard work weeks like Sunday through Thursday in Middle Eastern markets, use NETWORKDAYS.INTL which accepts a weekend code as an extra argument. The function returns a positive integer when end_date is later than start_date and a negative integer otherwise, just like DAYS does with calendar days.

DAYS Function: When to Use It and When to Skip It

Pros

  • Simple two-argument syntax that takes minutes to learn
  • Officially documented and supported by Microsoft long term
  • Works identically across Windows, Mac, and Excel for the web
  • Returns clean integers with no time zone or fractional issues
  • Accepts cell references, DATE function results, and text dates
  • Handles negative results gracefully for countdown formulas
  • Compatible with array formulas, SUMPRODUCT, and dynamic arrays

Cons

  • Counts all calendar days including weekends and holidays
  • Argument order is opposite of subtraction, confusing newcomers
  • Not available in Excel 2010 or earlier legacy versions
  • Text date strings can fail on non-US locale settings
  • Ignores time portions, no fractional day output available
  • Cannot calculate months or years like DATEDIF can
  • Requires manual holiday handling unlike NETWORKDAYS function
FREE Excel Functions Questions and Answers
Master Excel functions including DAYS, NETWORKDAYS, DATEDIF, and other essential date formulas.
FREE Excel MCQ Questions and Answers
Multiple choice questions covering Excel formulas, functions, and spreadsheet best practices.

DAYS Function Setup Checklist for Your First Formula

Confirm both cells contain real date values, not text strings
Format the result cell as General or Number, never Date
Verify end_date is later than start_date for positive results
Use absolute references with dollar signs when copying down columns
Test the formula on a known date pair like Jan 1 to Dec 31
Wrap with IFERROR to catch invalid date inputs gracefully
Combine with TODAY for live aging calculations that refresh daily
Document the formula purpose with a cell comment for teammates
Validate edge cases like February 29 in leap years carefully
Save a template version before adapting it to production data
The Self-Updating Aging Formula Every Analyst Needs

Use =DAYS(TODAY(), invoice_date_cell) to build aging columns that automatically refresh every time the workbook opens. This single pattern powers accounts receivable dashboards at thousands of companies worldwide and eliminates the need for manual recalculation. Pair it with conditional formatting to flag invoices over 30, 60, or 90 days old in seconds.

The real power of DAYS becomes clear when you see it applied to actual business problems. Let us walk through five concrete scenarios where this function quietly drives critical reporting and decision making across departments. Each example uses simple cell references and minimal nesting so you can adapt the pattern to your own workbook in under five minutes of focused effort, even if you have only basic spreadsheet experience under your belt today.

Accounts receivable aging is the classic use case. In column A you have invoice numbers, column B has issue dates, and column C calculates =DAYS(TODAY(),B2). The result is the number of days the invoice has been outstanding. Add a fourth column with nested IF statements that bucket the result into 0-30, 31-60, 61-90, and 90-plus categories. Finance teams use this exact pattern to generate weekly collection priority lists for the credit team.

Employee tenure tracking is another natural fit. Human resources teams maintain rosters with hire dates in one column and use =DAYS(TODAY(),hire_date_cell)/365.25 to compute years of service for anniversary recognition, vacation accrual, and benefits eligibility. The 365.25 divisor accounts for leap years and produces a result accurate to within a day or two over typical employment durations of five to fifteen years at most organizations across the country.

Contract expiration alerts work in reverse direction. Place renewal dates in column B and use =DAYS(B2,TODAY()) to compute days until expiration. Wrap the formula in IF logic that displays warnings like "EXPIRES SOON" when the result drops below 30 or "EXPIRED" when it goes negative. Legal and procurement teams rely on this pattern to avoid auto-renewal surprises and missed negotiation windows that cost thousands in unnecessary fees.

Project milestone variance is calculated by comparing planned and actual completion dates side by side. Column B holds the planned date, column C holds the actual date, and column D contains =DAYS(C2,B2). A positive result means the milestone slipped past its plan, while a negative result means the team delivered early. Project managers roll these variances up to portfolio level dashboards that executives review during monthly steering committee meetings.

Customer churn analysis uses DAYS to measure days since last purchase. Marketing teams build segmentation cohorts based on =DAYS(TODAY(),last_order_date) and trigger re-engagement campaigns when customers cross 60, 90, or 180 day thresholds. The same pattern works for subscription renewal predictions, content engagement scoring, and lifecycle stage classification in any customer relationship management system that exports cleanly to Excel format for further analysis.

Even a simple function like DAYS can throw errors that stop your workflow cold if you do not know what they mean. The three most common error messages are #VALUE!, #NUM!, and #NAME?, and each has a specific root cause that you can diagnose in under a minute once you recognize the pattern. Let us go through each one in detail so you can fix formulas quickly the next time something looks wrong on your dashboard during a critical reporting deadline at the end of the quarter.

#VALUE! appears when one of your arguments is text that Excel cannot interpret as a date. The fix is to check the source cells for stray characters, leading apostrophes, or values that look like dates but are actually formatted as text. Use the ISNUMBER function to test whether each cell holds a real date serial number, since dates are technically numbers under the hood. If ISNUMBER returns FALSE, you have a text value that needs conversion before the DAYS function can process it correctly.

#NUM! errors are rare with DAYS but can occur if you pass extremely large or negative serial numbers that fall outside the valid date range of January 1, 1900 to December 31, 9999. This usually happens when a calculation upstream produces an unexpected result that flows into your DAYS formula as input. Trace the source by clicking Trace Precedents in the Formula Auditing ribbon group to identify where the bad number originated in your workbook before attempting any other troubleshooting steps.

#NAME? means you misspelled the function name or you are working in a version older than Excel 2013 where DAYS does not exist yet. The fix for the spelling issue is obvious, but the version issue requires either upgrading Excel or falling back to simple subtraction like =B2-A2 with the result cell formatted as General to display the day count. Older versions also support DATEDIF as a workaround, although the argument order is reversed from DAYS as we discussed in earlier sections of this guide.

Locale issues cause subtle bugs that do not throw errors but produce wrong results silently. If your machine is set to British English with day-month-year format and a colleague sends a workbook saved on a US machine with month-day-year format, dates near the start of a month can be reinterpreted incorrectly. For example, 3/4/2026 could mean March 4 or April 3 depending on locale. Always use DATE function syntax or ISO format YYYY-MM-DD when sharing across regions to prevent this entire category of subtle bug.

Time component contamination is another silent killer. If your start_date cell secretly contains a time portion like 8:30 AM, DAYS still works correctly because it floors the serial number. But if you accidentally use subtraction instead of DAYS, you get a fractional result that displays as an integer in number format yet behaves like a decimal in further math. Always prefer DAYS over subtraction when integer day counts matter for your downstream calculations and aging reports.

Finally, watch for circular references when combining DAYS with TODAY in cells that themselves feed into date calculations elsewhere in your workbook. Excel will warn you with a status bar message, but the warning is easy to miss when you are working quickly. A circular reference involving TODAY can cause your entire workbook to recalculate slowly or produce inconsistent results between sessions, especially when you have iterative calculation enabled in your Excel options dialog box for some other reason entirely.

Practice More Excel Formulas Questions

Now that you understand the syntax, use cases, and common pitfalls, let us cover the advanced patterns that separate competent Excel users from true power users in the workplace. These techniques combine DAYS with other functions to solve problems that would otherwise require macros, Power Query transformations, or external scripts. Master these five patterns and you will handle 95 percent of date arithmetic challenges that come across your desk during a typical business week at any modern company today.

Pattern one is the conditional aging bucket. Wrap DAYS inside a nested IF or IFS statement to classify invoices into aging categories automatically. For example, =IFS(DAYS(TODAY(),B2)<=30,"Current",DAYS(TODAY(),B2)<=60,"31-60 Days",DAYS(TODAY(),B2)<=90,"61-90 Days",TRUE,"Over 90 Days") produces clean text labels that pivot tables can group and summarize without any helper columns or VBA code cluttering up your otherwise clean and presentable workbook structure.

Pattern two combines DAYS with SUMPRODUCT to count rows meeting date-based criteria across an entire range. The formula =SUMPRODUCT((DAYS(TODAY(),A2:A100)>60)*1) counts how many dates in the range are more than 60 days old. This is faster than COUNTIFS for complex multi-condition date filters and works in every Excel version from 2013 forward without requiring you to commit array formulas with Control plus Shift plus Enter keyboard combinations like the old days.

Pattern three integrates DAYS with conditional formatting to create visual heat maps. Select your aging column, open Conditional Formatting, choose Color Scales, and Excel will automatically shade newer invoices green and older invoices red. Combine this with data bars in an adjacent column for double visual encoding that makes overdue items leap off the page during stakeholder reviews. Executives appreciate visual cues that let them grasp the state of the business in seconds rather than minutes of staring at numbers.

Pattern four uses DAYS inside dynamic array formulas with the FILTER function. The formula =FILTER(A2:C100,DAYS(TODAY(),B2:B100)>90) returns only rows where the date in column B is more than 90 days old, automatically spilling the results into adjacent cells. This is the modern replacement for AutoFilter when you need a permanent filtered view that updates as source data changes throughout the day during active reporting cycles or month-end close processes at finance departments.

Pattern five wraps DAYS in IFERROR for production-grade robustness. The formula =IFERROR(DAYS(B2,A2),"") returns an empty string when either date is missing or invalid, keeping your dashboard clean and free of unsightly error indicators. Always add IFERROR wrappers to formulas that will be reviewed by executives or external auditors, since visible errors undermine confidence in your work even when the underlying logic is completely correct and the missing inputs are entirely expected for new records.

Finally, remember that DAYS is just one tool in a much larger date arithmetic toolkit. Pair it with EOMONTH for month-end calculations, EDATE for adding months to a date, WEEKDAY for day-of-week analysis, and WORKDAY for project scheduling. The combination of these functions covers virtually every date computation a business analyst will encounter during a career spanning decades. Bookmark the Excel function reference and revisit it whenever a new requirement lands on your desk that involves date math of any complexity.

FREE Excel Questions and Answers
Comprehensive Excel certification practice test covering formulas, functions, and spreadsheet skills.
FREE Excel Trivia Questions and Answers
Fun Excel trivia testing your knowledge of features, shortcuts, and lesser-known spreadsheet facts.

Excel Questions and Answers

What does the DAYS function do in Excel?

The DAYS function returns the number of calendar days between two dates as a whole integer. The syntax is =DAYS(end_date, start_date) where end_date is the later date and start_date is the earlier one. It counts every calendar day including weekends and holidays. If start_date is later than end_date, the result is negative, which is useful for countdown formulas and deadline tracking.

What is the difference between DAYS and DATEDIF?

DAYS calculates only the number of calendar days and uses the argument order end_date first, start_date second. DATEDIF is older, can return years, months, or days based on a third unit argument, and uses the opposite order with start_date first. DATEDIF is undocumented in modern Excel help but still functional. Use DAYS for simple day counts and DATEDIF only when you need months or years.

Why does DAYS return a negative number?

DAYS returns a negative number when the start_date argument is later than the end_date argument. This is by design, not a bug. Many analysts use the negative result intentionally for countdown formulas where a positive number means days until a deadline and a negative number means the deadline has already passed. If you want the absolute difference regardless of order, wrap the formula in ABS like =ABS(DAYS(A1,B1)).

Can DAYS handle text dates?

Yes, DAYS can accept text strings that Excel parses as dates, like =DAYS("2026-12-31","2026-01-01"). However, this only works reliably when the text matches your system locale settings. On machines configured for different date formats, text dates can be misinterpreted silently. The safest practice is to use real date values in cells or the DATE function like =DATE(2026,12,31) to avoid any locale-related ambiguity in your formulas.

How do I count business days only?

Use NETWORKDAYS instead of DAYS when you want to exclude weekends. The syntax is =NETWORKDAYS(start_date, end_date, [holidays]) with an optional third argument for a range of holiday dates. For non-standard work weeks like Sunday through Thursday, use NETWORKDAYS.INTL which accepts a weekend code. DAYS counts every calendar day, so it is the wrong choice for service level agreement tracking or shipping estimates where business days matter.

What versions of Excel support DAYS?

DAYS was introduced in Excel 2013 and is available in every version since, including Excel 2016, 2019, 2021, Microsoft 365, Excel for Mac, and Excel for the web. It is not available in Excel 2010 or earlier. If you need to work in legacy versions, use simple subtraction like =B2-A2 with the result cell formatted as General or Number to display the day count properly without errors.

Why does DAYS return a #VALUE! error?

A #VALUE! error from DAYS means one of your arguments cannot be interpreted as a valid date. Common causes include text strings with typos, cells formatted as text containing date-like values with leading apostrophes, or empty cells. Use ISNUMBER to verify each cell holds a real date serial number. To convert text dates to real dates, use DATEVALUE or paste them through the Text to Columns wizard with date format selected.

Can DAYS calculate fractional days with time?

No, DAYS always returns a whole integer and ignores any time component in the input cells. If your dates include times and you need fractional days, use simple subtraction like =B2-A2 instead and format the result as a general number. The result will include the fractional portion representing hours and minutes. For example, 1.5 means one day and twelve hours between the two timestamps in your data.

How do I use DAYS with TODAY for aging?

The formula =DAYS(TODAY(), invoice_date) calculates how many days have passed since the invoice date and updates automatically every time the workbook opens or recalculates. This pattern powers accounts receivable aging reports at thousands of companies worldwide. Combine with conditional formatting or nested IF statements to bucket invoices into 0-30, 31-60, 61-90, and over 90 day categories that finance teams review weekly for collections.

Does DAYS work with leap years correctly?

Yes, DAYS handles real leap years correctly. February 29 in years like 2024 and 2028 is counted as a normal day. However, Excel incorrectly treats 1900 as a leap year due to a legacy Lotus 1-2-3 compatibility bug. This means calculations crossing February 28, 1900 to March 1, 1900 are off by one day. The bug rarely affects business data, but verify results manually if your work touches that historical date range.
โ–ถ Start Quiz