Excel Practice Test

β–Ά

Knowing how to subtract dates in Excel is one of the most practical skills you can build in a spreadsheet environment. Whether you are tracking project timelines, calculating employee tenure, measuring the days between invoices, or planning an event schedule, date arithmetic shows up constantly in real-world work. Excel stores every date as a serial number β€” January 1, 1900 equals 1, and every subsequent day adds one to that count β€” which means subtracting two dates is fundamentally the same as subtracting two ordinary numbers. That elegance hides surprising edge cases, and this guide covers all of them.

Knowing how to subtract dates in Excel is one of the most practical skills you can build in a spreadsheet environment. Whether you are tracking project timelines, calculating employee tenure, measuring the days between invoices, or planning an event schedule, date arithmetic shows up constantly in real-world work. Excel stores every date as a serial number β€” January 1, 1900 equals 1, and every subsequent day adds one to that count β€” which means subtracting two dates is fundamentally the same as subtracting two ordinary numbers. That elegance hides surprising edge cases, and this guide covers all of them.

For anyone who has worked with financial models using subtract dates in excel alongside functions like PMT or NPV, you already know that accurate date spans are critical. A single off-by-one error in a loan amortization schedule or a bond maturity countdown can cascade into thousands of dollars of incorrect calculations. Understanding the mechanics behind Excel's date serial system is therefore not just a convenience β€” it is a prerequisite for trustworthy financial work.

The simplest approach to date subtraction is the plain minus operator. If cell A2 holds a start date and B2 holds an end date, entering =B2-A2 returns the number of days between them. Excel automatically formats the result as a date rather than a number in many versions, so you often need to reformat the output cell as a General or Number type to see the integer you expect. This small formatting step trips up countless beginners and is worth memorizing immediately.

Beyond simple subtraction, Excel offers the DATEDIF function, which calculates the difference between two dates in days, complete months, or complete years. DATEDIF is intentionally hidden from the function wizard β€” Microsoft documented it for Lotus 1-2-3 compatibility but never officially promoted it β€” yet it remains fully functional in every modern version of Excel including Microsoft 365. Its syntax is =DATEDIF(start_date, end_date, unit), where the unit argument can be "D" for days, "M" for months, "Y" for years, or combinations like "YM" for months excluding full years.

The DAYS function, introduced in Excel 2013, provides an explicit alternative to the minus operator. Its syntax is =DAYS(end_date, start_date), and it returns the number of days between the two dates as a plain integer with no formatting ambiguity. Many professionals prefer DAYS over the minus operator precisely because the output is unambiguously numeric, reducing the chance of accidental date formatting on the result cell. The NETWORKDAYS and NETWORKDAYS.INTL functions extend this capability to working-day calculations, excluding weekends and specified holidays automatically.

Date subtraction also powers many lookup and comparison scenarios. When you combine it with VLOOKUP in Excel to match records by date range, or when you build conditional formatting rules that highlight overdue items, the underlying engine is always the same serial number arithmetic. Understanding how Excel represents dates internally makes these advanced scenarios much more intuitive, because you are simply comparing integers rather than wrestling with opaque date objects.

This guide walks through every major technique for subtracting dates in Excel: the minus operator, DATEDIF, DAYS, NETWORKDAYS, and EDATE-based month arithmetic. Each section includes concrete formula examples, explains common error messages, and highlights the edge cases that most tutorials skip. By the end, you will be able to calculate any date span accurately and confidently in any version of Excel.

Excel Date Calculations by the Numbers

πŸ“…
2,958,465
Maximum Date Serial
πŸ“Š
6
DATEDIF Unit Codes
⏱️
5
Key Date Functions
🎯
1900
Excel Date Epoch
πŸ’»
365.25
Avg Days Per Year
Test Your Skills: Subtract Dates in Excel Practice Questions

Core Date Subtraction Methods in Excel

βž–

Enter =B2-A2 where B2 is the end date and A2 is the start date. Format the result cell as Number or General to see the integer day count. This is the fastest method and works in every Excel version since 1985.

πŸ“…

Use =DAYS(end_date, start_date) for an explicit, formatting-safe result. Available in Excel 2013 and later. The argument order is reversed from what many expect β€” end date comes first. Returns a plain integer, never a date-formatted value.

πŸ”’

Use =DATEDIF(start_date, end_date, "D") for days, "M" for complete months, or "Y" for complete years. Unlike the minus operator, DATEDIF is unit-aware and handles month-boundary arithmetic automatically. Start date must be earlier than end date.

🏒

Use =NETWORKDAYS(start_date, end_date, holidays) to count only Monday–Friday working days, optionally skipping a range of holidays. Use NETWORKDAYS.INTL to define custom weekend patterns for non-standard work schedules like Sunday–Thursday.

πŸ“

After calculating a day difference, use =TEXT(days,"0 \d\a\y\s") or concatenate with &" days" to display human-readable output. For compound results like "2 years, 3 months", combine multiple DATEDIF calls with the & operator and literal text strings.

The DATEDIF function is Excel's most powerful tool for date subtraction because it understands calendar units rather than just counting raw days. Its full syntax is =DATEDIF(start_date, end_date, unit), and the unit argument is what makes it uniquely versatile. Using "D" returns the total number of days between the two dates, identical to a minus operation. Using "M" returns the number of complete calendar months, which is far more useful than dividing days by 30 when you need precise month counts for billing cycles, subscription durations, or HR tenure calculations.

The "Y" unit returns complete calendar years, making DATEDIF the standard tool for age calculations. A formula like =DATEDIF(B2, TODAY(), "Y") placed next to a birthday column immediately gives you each person's current age in whole years. The compound units are even more powerful: "YM" gives months remaining after subtracting whole years, and "MD" gives days remaining after subtracting whole months, so combining =DATEDIF(B2,TODAY(),"Y")&" years, "&DATEDIF(B2,TODAY(),"YM")&" months, "&DATEDIF(B2,TODAY(),"MD")&" days" produces a precise age string like "34 years, 7 months, 12 days."

One critical warning about DATEDIF: the start date must always be less than or equal to the end date. If the start date is later, the function returns a #NUM! error rather than a negative value. This is different from the minus operator, which happily returns a negative number when the start date is in the future. A best practice is to wrap DATEDIF in an IFERROR or add an IF check: =IF(A2>B2,"Check dates",DATEDIF(A2,B2,"D")) protects against user entry errors without crashing the formula.

Excel 365 users also have access to the DAYS360 function, which calculates date differences based on a 360-day year (twelve 30-day months) commonly used in financial bond calculations. This is not the same as a regular day count and should only be used in contexts like bond accrual schedules or certain banking applications where 30/360 day-count conventions are explicitly specified. Mixing DAYS360 with regular date subtraction in the same model is a common source of subtle but significant calculation errors.

For month-based arithmetic beyond counting, the EDATE function moves a date forward or backward by a specified number of months. =EDATE(A2, 3) returns the date exactly three months after A2, correctly handling month-end edge cases like February. If A2 is January 31 and you add one month with EDATE, you get February 28 (or 29 in a leap year), not March 3 β€” the function clamps to the last valid day of the target month. Combining EDATE with subtraction lets you calculate things like contract renewal dates or subscription expiration windows with calendar-accurate precision.

The EOMONTH function complements EDATE by returning the last day of a month a given number of months away. =EOMONTH(A2, 0) gives the last day of A2's month, =EOMONTH(A2, 1) gives the last day of the following month. This is invaluable for quarterly reporting periods, monthly billing cutoffs, and any scenario where you need to snap a date to a month boundary. Subtracting two EOMONTH values gives you the exact number of days in a billing period without any approximation.

Understanding how to create a drop down list in Excel to select date ranges and feed them into DATEDIF formulas is a common workflow in dashboard building. You can set up a validation drop-down with preset period names like "Last 30 Days," "Last Quarter," or "Year to Date," then use CHOOSE or SWITCH to map those labels to start dates calculated relative to TODAY(). This creates a self-updating date range selector that drives downstream DATEDIF calculations without the user ever manually entering dates, reducing input errors dramatically in shared workbooks.

FREE Excel Basic and Advance Questions and Answers
Test your Excel fundamentals and advanced skills with comprehensive practice questions
FREE Excel Formulas Questions and Answers
Practice Excel formula writing including date, text, and math functions

How to Freeze a Row in Excel and Other Essential Excel Techniques

πŸ“‹ NETWORKDAYS Explained

The NETWORKDAYS function counts working days between two dates, automatically excluding Saturdays and Sundays. Its syntax is =NETWORKDAYS(start_date, end_date, [holidays]) where the optional holidays argument accepts a range of cells containing dates to skip. For example, =NETWORKDAYS("2024-01-01", "2024-01-31", HolidayList) returns the number of business days in January 2024, minus any dates listed in HolidayList. This is essential for SLA tracking, project scheduling, and payroll period calculations in any business context.

NETWORKDAYS.INTL extends this capability with a weekend parameter that lets you define which days of the week are non-working. The second argument accepts either a weekend code (1 = Saturday/Sunday, 11 = Sunday only, 14 = Thursday/Friday for Middle Eastern schedules) or a seven-character string like "1000001" where 1 means non-working. This makes NETWORKDAYS.INTL suitable for international organizations with non-standard work weeks, call centers operating on rotating schedules, or any business where the traditional Monday–Friday assumption does not apply.

πŸ“‹ Merging Date Data with VLOOKUP

VLOOKUP in Excel pairs naturally with date subtraction when you need to calculate durations based on records stored in separate tables. A common pattern is using VLOOKUP to retrieve a start date from a reference table based on an ID, then subtracting that retrieved date from a second column. For example, =TODAY()-VLOOKUP(A2, ContractTable, 3, FALSE) finds the contract start date for the ID in A2 and immediately calculates how many days the contract has been active, all in one formula without any helper columns.

When how to merge cells in Excel is relevant to date displays, note that merged cells in header rows are purely cosmetic and do not affect formula calculation. However, merging cells that contain dates used in subtraction formulas is a common source of confusion: a merged cell spanning B2:C2 stores its value only in B2, so formulas referencing C2 will return zero or an error. Always reference the top-left cell of a merged range in date formulas, or better yet, avoid merging data cells entirely and use Center Across Selection formatting as a visual alternative.

πŸ“‹ Freezing Rows for Date Headers

When building date calculation sheets with many rows of data, knowing how to freeze a row in Excel keeps column headers visible as you scroll. Go to View > Freeze Panes > Freeze Top Row to lock row 1 in place, or select the row below where you want the freeze line and choose Freeze Panes for more control. In date-heavy workbooks where column A might contain labels like Start Date, End Date, Days Elapsed, and Working Days, freezing the header row prevents constant scrolling back to identify which formula belongs in which column.

For dashboards that display date difference calculations across hundreds of records, combining freeze panes with Excel's Table feature (Insert > Table) gives you the best of both worlds: frozen headers through freeze panes, and automatic formula propagation through Table structured references. When you enter a date subtraction formula in the first data row of a Table column, Excel immediately fills the same formula down to all other rows. Structured references like =[@EndDate]-[@StartDate] are also more readable than cell addresses and automatically adjust when rows are inserted or deleted.

Minus Operator vs. DATEDIF: Which Should You Use?

Pros

  • Minus operator is instant to type and requires no function knowledge
  • DATEDIF handles months and years without manual division or rounding
  • DAYS function returns unambiguous integers with no formatting risk
  • NETWORKDAYS automatically handles weekends and holidays in one formula
  • DATEDIF compound units (YM, MD) produce human-readable duration strings
  • EDATE and EOMONTH handle month-end edge cases that arithmetic cannot

Cons

  • Minus operator result often auto-formats as a date instead of a number
  • DATEDIF is undocumented and absent from the function wizard autocomplete
  • DATEDIF throws #NUM! if the start date is later than the end date
  • NETWORKDAYS counts both endpoints as working days, which can overcount by one
  • DAYS360 is frequently confused with DAYS and produces wrong results outside finance
  • Date serial differences do not account for time components β€” use INT() to strip time fractions
FREE Excel Functions Questions and Answers
Quiz yourself on Excel date, lookup, and statistical functions with instant feedback
FREE Excel MCQ Questions and Answers
Multiple choice questions covering all core Excel topics for certification prep

Date Subtraction in Excel: Essential Checklist

Verify that both date cells are formatted as Date, not Text, before subtracting
Format the result cell as Number or General to display the integer day count
Use DATEDIF with "M" or "Y" when you need complete calendar months or years
Wrap DATEDIF in IFERROR to handle cases where start date exceeds end date
Use NETWORKDAYS instead of the minus operator when excluding weekends matters
Add a holidays range as the third argument to NETWORKDAYS for accurate business day counts
Use EDATE instead of adding 30 days when moving forward by exact calendar months
Use INT() to strip time fractions from DateTime values before date subtraction
Test date formulas with known dates whose correct answer you can verify manually
Use TODAY() for dynamic calculations that update automatically each day the file is opened
Dates Stored as Text Are the #1 Source of Date Errors

If a date subtraction returns #VALUE!, the most likely cause is that one or both date cells contain text that looks like a date but is not recognized as one by Excel. Use =ISNUMBER(A2) to test β€” a real date returns TRUE because dates are numbers internally. To convert text dates to real dates, try the DATEVALUE function: =DATEVALUE(A2) parses most text date formats. Alternatively, select the column, run Data > Text to Columns, and choose Date as the column data format to force Excel to reparse the values.

Common errors in date subtraction formulas fall into predictable categories, and recognizing them quickly is what separates casual Excel users from power users. The most frequent is the #VALUE! error, which almost always means one of the date inputs is stored as text rather than as a numeric date serial. This happens constantly when dates are imported from external systems β€” CSV exports from databases, ERP systems, or web scraping tools often deliver dates as strings like "2024-01-15" or "01/15/2024" that Excel does not automatically convert. The DATEVALUE function or a Text to Columns conversion fixes this in seconds.

The second most common error is the result cell displaying a date instead of a number. When you subtract two date-formatted cells, Excel inherits the date format for the result. The cell might display something like "January 15, 1900" when it should show "15." This is not a calculation error β€” the underlying value is correct β€” but the formatting misleads users into thinking something is wrong. Simply select the result cell, press Ctrl+1 to open Format Cells, and choose Number or General. The correct integer will immediately appear.

Off-by-one errors are the third category and the most insidious because they produce plausible-looking wrong answers. The confusion usually comes from whether both the start and end dates should be counted. The minus operator counts the span exclusive of the start date: =DATE(2024,1,31)-DATE(2024,1,1) returns 30, not 31. If you need to count both endpoints β€” for instance, counting total calendar days in January including both January 1 and January 31 β€” add 1 to the result. NETWORKDAYS, conversely, counts both endpoints as working days, so a project starting and ending on the same day returns 1, not 0.

Time components hidden inside DateTime values cause a subtle but dangerous problem. If a cell contains the value 45292.5, Excel displays it as a date with a time component (noon on whatever date 45292 represents). When you subtract two such DateTime cells, the result is fractional β€” 2.5 days instead of 2 days, for example β€” which breaks downstream formulas expecting integers. Wrapping the subtraction in INT() removes the decimal: =INT(B2-A2) gives clean whole-day counts regardless of any time components stored in the cells. Always check whether your source data includes times before choosing a subtraction method.

The DATEDIF "MD" unit has a known bug in certain versions of Excel where it returns incorrect results for some month-end combinations, particularly when the start date falls at the end of a long month and the end date falls at the end of a short month. Microsoft has acknowledged this behavior but never patched it.

A workaround is to calculate days separately using the minus operator for the day component rather than relying on "MD". For most practical applications the bug rarely triggers, but in date-critical systems like insurance policy calculations or legal deadline tracking, testing with edge case dates like January 31 to March 1 is strongly recommended.

Circular reference errors appear when a date formula inadvertently references the cell containing its result, usually through a named range that was accidentally defined to include the formula cell itself. Excel will display a circular reference warning in the status bar and return 0 for the affected cell. To diagnose, use Formulas > Error Checking > Circular References to find the exact cell. Date subtraction formulas are particularly prone to this in dashboards where output cells are later used as input to other date calculations, and a misconfigured named range spans both input and output cells.

Regional locale settings affect how Excel parses date literals typed directly into formulas. In the US locale, =DATEDIF("1/15/2024", "3/20/2024", "D") works correctly with month/day/year order. In European locales, the same string might be parsed as day/month/year, producing a #VALUE! error if the day value exceeds 12. Best practice is never to hardcode date strings in formulas β€” use DATE(year, month, day) instead: =DATEDIF(DATE(2024,1,15), DATE(2024,3,20), "D") works correctly in every locale without ambiguity.

Advanced date calculation scenarios in Excel go well beyond simple subtraction and open up powerful analytical capabilities. One of the most useful advanced patterns is calculating the age or tenure of items in a dataset dynamically. By combining =DATEDIF(start_date, TODAY(), "Y") with conditional formatting, you can build a live employee tenure dashboard where rows automatically highlight when employees hit milestone anniversaries β€” one year, five years, ten years β€” without any manual updating. The formula recalculates every time the workbook opens, always reflecting the current date.

Date subtraction drives cohort analysis in sales and marketing data. If you have a table of customer acquisition dates and purchase transaction dates, subtracting the acquisition date from each transaction date gives you the customer age in days at the time of purchase. Grouping those day values into buckets (0–30 days, 31–90 days, 91–365 days, 365+ days) using nested IF or IFS formulas lets you see exactly when customers are most likely to make repeat purchases. This is foundational for email timing strategies, loyalty program design, and customer lifetime value modeling.

Project management workbooks rely heavily on date subtraction for Gantt chart calculations. A typical Gantt formula calculates a task bar's width by subtracting the project start date from the task end date, and its offset from the left edge by subtracting the project start date from the task start date. Formatting these results as conditional bar widths using either Conditional Formatting data bars or manual chart series produces a visual timeline entirely within Excel, with no external tools required. Adding NETWORKDAYS ensures the bar widths reflect working days rather than calendar days when schedules are expressed in business days.

Loan and lease calculations use date subtraction extensively alongside financial functions. When computing the exact number of payment periods in a loan from the disbursement date to the maturity date, DATEDIF with "M" gives the most accurate period count, which feeds directly into PMT, PV, and FV functions.

Using an approximate period count based on dividing days by 30 introduces rounding errors that compound over a multi-year loan, so calendar-aware month counting with DATEDIF is always preferred in financial models. For anyone working with subtract dates in excel in the context of bond pricing or mortgage amortization, this distinction is non-negotiable.

Date subtraction combined with array formulas or SUMPRODUCT enables powerful aggregation queries. For example, =SUMPRODUCT((DATEDIF(StartDates, TODAY(), "D")<=90)*Revenue) sums revenue from all contracts that started within the last 90 days, without any helper columns or filter steps. Extending this pattern with multiple conditions β€” date range AND category AND region β€” lets you build multi-dimensional KPI summaries that update dynamically as data changes. This is the kind of formula work that separates basic Excel users from the analysts who produce dashboards that executives actually trust.

Dynamic date ranges are a key building block for automated reporting. Using =EOMONTH(TODAY(), -1)+1 as a start date and =EOMONTH(TODAY(), -1) as an end date gives you the exact first and last day of the previous calendar month, regardless of which month or year you are in.

Subtracting these two values always returns the correct number of days in last month β€” 28, 29, 30, or 31 β€” which you can then use to annualize monthly metrics accurately. Combining this with NETWORKDAYS gives the exact number of business days in the period, which is essential for normalizing metrics like daily call volume or average daily revenue across months of different lengths.

Excel's inner excellence as a calculation platform is most visible in date arithmetic scenarios because dates expose the tension between human calendar conventions and computer numeric representation. Mastering the full toolkit β€” minus operator for speed, DATEDIF for calendar units, NETWORKDAYS for business schedules, EDATE for month-accurate projections, and EOMONTH for period boundaries β€” makes you capable of answering virtually any date-span question a business stakeholder can pose, entirely within a spreadsheet without writing a single line of code. That versatility is why date calculation proficiency remains a core expectation in data analyst job descriptions across every industry.

Practice Excel Formula Skills Including Date Functions

Building reliable date calculation habits starts with one foundational rule: always verify that your date inputs are genuine numeric dates, not text strings that look like dates. Before writing any date subtraction formula in a new dataset, take thirty seconds to check a sample cell with =ISNUMBER(A2). If it returns FALSE, stop and fix the data before proceeding. Trying to debug a chain of dependent formulas when the root cause is a text-formatted date in the source table is one of the most time-consuming mistakes in spreadsheet work, and it is completely avoidable with this single upfront check.

Naming your date columns and result columns clearly pays dividends in maintainability. A column header of "Contract Start Date" combined with a Table structured reference produces formulas like =[@[Contract End Date]]-[@[Contract Start Date]] that are self-documenting. Anyone reading the workbook three months later β€” including yourself β€” immediately understands what is being calculated without tracing cell addresses back to headers. This clarity is especially important in shared workbooks where multiple team members may need to audit or extend the calculations.

When building date calculations for others to use, protect your formula cells using Excel's cell protection features. Go to Format Cells > Protection > Locked for the formula cells, then use Review > Protect Sheet to prevent accidental overwrites. Allowing users to enter dates only in designated input cells while locking all formula cells that perform the subtraction is standard practice for any production workbook that will be used regularly. This structure also makes it easy to see at a glance which cells are meant to receive user input versus which cells are derived.

Testing date formulas with boundary cases before deploying them is critical. Test with dates that cross year boundaries (December 31 to January 1), leap year February 29, month-end to month-start transitions, and dates where start and end are identical. Each of these edge cases can reveal unexpected behavior in functions like DATEDIF that handle calendar boundaries with special logic. Creating a small test table with a column of known inputs and a column of expected outputs β€” which you manually calculate β€” gives you a regression test you can rerun whenever you modify the formula.

Excel's institute of creative excellence in formula design is often demonstrated through efficient use of helper columns. Rather than writing one massive nested formula that calculates years, months, and days all in a single cell, consider using three separate helper columns β€” one for DATEDIF with "Y", one for "YM", one for "MD" β€” and then concatenating them in a display column. This decomposition makes each piece individually testable, makes the logic transparent to reviewers, and makes debugging trivially easy. You can hide the helper columns after verification if a clean visual appearance is required.

Documentation comments inside Excel cells using Insert > Comment (or Notes in Excel 365) are underutilized in date calculation workbooks. Adding a comment to a key DATEDIF formula explaining which unit is being used and why, or noting that a particular cell uses NETWORKDAYS.INTL with a custom weekend code for a Middle Eastern office, prevents future confusion when the workbook is revisited after months of disuse. Comments are invisible during normal use but visible on hover, making them the ideal place to record non-obvious choices without cluttering the visual appearance of the sheet.

Staying current with Excel's expanding date function library pays off over time. Microsoft 365 has introduced functions like SEQUENCE, FILTER, and XLOOKUP that work powerfully with date arithmetic in ways that were impossible before dynamic arrays. =SEQUENCE(12, 1, DATE(2024,1,1), 30) generates a column of twelve dates spaced 30 days apart, which you can immediately pass to DATEDIF or NETWORKDAYS for batch calculations.

As Excel's inner excellence continues to evolve through regular Microsoft 365 updates, the combination of dynamic arrays with traditional date functions opens up possibilities that once required VBA macros or Power Query, making pure-formula date analysis more accessible than ever before.

FREE Excel Questions and Answers
Full-length Excel certification practice test with date, formula, and function questions
FREE Excel Trivia Questions and Answers
Fun Excel trivia covering history, features, shortcuts, and date function facts

Excel Questions and Answers

How do I subtract dates in Excel to get the number of days?

Simply enter =B2-A2 where B2 is the later date and A2 is the earlier date. The result will be the number of days between them. However, Excel often formats the result cell as a date, so you need to change the cell format to Number or General (Ctrl+1) to see the integer day count. Alternatively, use =DAYS(B2,A2) which always returns a plain integer without formatting issues.

What is the DATEDIF function and why is it not in the function wizard?

DATEDIF calculates the difference between two dates in days, months, or years using a unit argument ("D", "M", "Y", "YM", "MD", "YD"). Microsoft included it for Lotus 1-2-3 compatibility but never officially documented it in Excel's help system, so it does not appear in the function autocomplete wizard. Despite this, it is fully functional in all versions of Excel including Microsoft 365 and is widely used in HR and financial calculations.

Why does my date subtraction return a date instead of a number?

When you subtract two date-formatted cells, Excel inherits the date format for the result cell. The underlying calculation is correct β€” it is just displayed as a date rather than an integer. To fix it, select the result cell, press Ctrl+1 to open Format Cells, and change the format category to Number or General. The correct day count will immediately appear. Using the DAYS function instead of the minus operator avoids this formatting issue entirely.

How do I calculate the number of working days between two dates in Excel?

Use =NETWORKDAYS(start_date, end_date) to count Monday–Friday working days between two dates. Add a third argument with a range of holiday dates to exclude them: =NETWORKDAYS(A2, B2, HolidayRange). For non-standard work weeks, use NETWORKDAYS.INTL with a weekend parameter: =NETWORKDAYS.INTL(A2, B2, 11) counts working days with only Sunday as a weekend. Both functions count both the start and end dates as working days if they fall on weekdays.

What does the #VALUE! error mean in a date subtraction formula?

A #VALUE! error in date subtraction almost always means one or both date cells contain text that looks like a date but is not stored as a numeric date value. Test with =ISNUMBER(A2) β€” if it returns FALSE, the cell contains text. Fix by using =DATEVALUE(A2) to convert text dates to real dates, or select the column and use Data > Text to Columns with Date format selected. Dates imported from external systems often arrive as text strings.

How do I calculate someone's age in Excel using their birth date?

Use =DATEDIF(birthdate_cell, TODAY(), "Y") to calculate a person's age in complete years. Replace TODAY() with a specific date if you want the age as of a particular point in time. For a more detailed output showing years, months, and days, combine three DATEDIF calls: =DATEDIF(A2,TODAY(),"Y")&" yrs, "&DATEDIF(A2,TODAY(),"YM")&" mos, "&DATEDIF(A2,TODAY(),"MD")&" days". Ensure the birth date cell is formatted as a date and contains a real numeric date value.

How do I add or subtract months from a date in Excel?

Use the EDATE function: =EDATE(start_date, months) where months is a positive number to move forward or negative to move backward. For example, =EDATE(A2, 3) returns the date three months after A2. EDATE correctly handles month-end edge cases β€” adding one month to January 31 returns February 28 (or 29 in a leap year), not March 3. Never add 30 or 31 days to approximate a month advance, as this drifts increasingly out of alignment with the calendar.

Why does DATEDIF return a #NUM! error?

DATEDIF returns #NUM! when the start date is later than the end date. Unlike the minus operator, which returns a negative number for reversed dates, DATEDIF requires the first argument to be chronologically earlier. Protect against user entry errors with: =IF(A2>B2, "Check dates", DATEDIF(A2, B2, "D")). Alternatively, use =IFERROR(DATEDIF(A2, B2, "D"), "Invalid dates") to silently handle the error with a user-friendly message.

How do I subtract dates in Excel when cells contain both date and time?

DateTime values include a decimal fraction representing the time component (0.5 = noon, 0.75 = 6 PM). Subtracting two DateTime values returns a fractional result like 2.5 instead of 2 whole days. To get clean whole-day counts, wrap the subtraction in INT(): =INT(B2-A2). To extract only the time difference, use =MOD(B2-A2, 1) which returns the fractional part. If you need both days and hours, calculate =INT(B2-A2) for days and =HOUR(MOD(B2-A2,1)) for remaining hours.

What is the difference between DAYS and DATEDIF in Excel?

DAYS(end_date, start_date) returns the total number of calendar days between two dates as a plain integer, always. It is simple, always returns a number, and is available in Excel 2013 and later. DATEDIF(start_date, end_date, unit) is far more flexible β€” it can return days, complete months, complete years, or compound units like months-within-a-year. DAYS is better for simple day counts due to its formatting safety. DATEDIF is necessary when you need calendar-aware units like months or years.
β–Ά Start Quiz