How To Calculate Days In Excel In Dd Mm Yyyy

Excel Date Calculator (DD-MM-YYYY)

Calculate days between dates, add/subtract days, and convert dates to DD-MM-YYYY format in Excel with this interactive tool.

Results

Total Days:
Resulting Date:
Excel Formula:

Complete Guide: How to Calculate Days in Excel (DD-MM-YYYY Format)

Excel is one of the most powerful tools for date calculations, but many users struggle with formatting dates correctly (especially in DD-MM-YYYY format) and performing accurate day calculations. This comprehensive guide will teach you everything you need to know about working with dates in Excel, including:

  • Understanding Excel’s date system
  • Calculating days between dates
  • Adding/subtracting days from dates
  • Converting dates to DD-MM-YYYY format
  • Handling common date calculation errors
  • Advanced techniques with WORKDAY and NETWORKDAYS functions

1. Understanding Excel’s Date System

Excel stores dates as sequential serial numbers called date values. Here’s what you need to know:

  • January 1, 1900 is stored as serial number 1
  • Each subsequent day increments by 1 (January 2, 1900 = 2, etc.)
  • Times are stored as fractional portions of a day (0.5 = 12:00 PM)
  • This system allows Excel to perform calculations with dates

Important: Excel for Windows uses the 1900 date system, while Excel for Mac (prior to 2011) used the 1904 date system. All modern versions now use 1900.

Why DD-MM-YYYY Format Matters

The DD-MM-YYYY format (day-month-year) is:

  1. Internationally recognized – Used in most countries outside the US
  2. Logical – Progresses from smallest to largest time unit
  3. Less ambiguous – Avoids confusion with MM-DD-YYYY format
  4. ISO 8601 compliant – The international standard (YYYY-MM-DD is the basic format, but DD-MM-YYYY is widely accepted)

2. Basic Date Calculations in Excel

Method 1: Simple Subtraction for Days Between Dates

The simplest way to calculate days between dates is to subtract one date from another:

=B2-A2

Where:

  • A2 contains the start date
  • B2 contains the end date

Example: If A2 = 15-06-2023 and B2 = 30-06-2023, the result will be 15 days.

Pro Tip: Always format your date cells as DD-MM-YYYY before performing calculations to avoid errors. Select cells → Right-click → Format Cells → Custom → Type “dd-mm-yyyy”.

Method 2: Using the DATEDIF Function

The DATEDIF function provides more control over date calculations:

=DATEDIF(start_date, end_date, unit)
Unit Description Example Result
“d” Days between dates =DATEDIF(“15-06-2023″,”30-06-2023″,”d”) → 15
“m” Complete months between dates =DATEDIF(“15-06-2023″,”30-11-2023″,”m”) → 5
“y” Complete years between dates =DATEDIF(“15-06-2020″,”15-06-2023″,”y”) → 3
“ym” Months between dates after complete years =DATEDIF(“15-06-2020″,”30-11-2023″,”ym”) → 5
“yd” Days between dates after complete years =DATEDIF(“15-06-2023″,”30-06-2023″,”yd”) → 15
“md” Days between dates after complete months/years =DATEDIF(“15-06-2023″,”30-06-2023″,”md”) → 15

Method 3: Adding or Subtracting Days

To add days to a date:

=A2+30

Where A2 contains the start date and 30 is the number of days to add.

To subtract days from a date:

=A2-15

3. Advanced Date Functions

WORKDAY Function (Excluding Weekends)

Calculates workdays between dates, excluding weekends and optionally holidays:

=WORKDAY(start_date, days, [holidays])

Example: Calculate the due date 10 workdays after 15-06-2023:

=WORKDAY("15-06-2023", 10)

NETWORKDAYS Function (Counting Workdays)

Counts the number of workdays between two dates:

=NETWORKDAYS(start_date, end_date, [holidays])

Example: Count workdays between 15-06-2023 and 30-06-2023:

=NETWORKDAYS("15-06-2023", "30-06-2023")
Function Purpose Example Result
WORKDAY Returns a date after adding workdays =WORKDAY(“15-06-2023”, 5) 22-06-2023
NETWORKDAYS Counts workdays between dates =NETWORKDAYS(“15-06-2023”, “30-06-2023”) 12
WORKDAY.INTL WORKDAY with custom weekends =WORKDAY.INTL(“15-06-2023”, 5, 11) 22-06-2023 (Sun-Sat weekend)
NETWORKDAYS.INTL NETWORKDAYS with custom weekends =NETWORKDAYS.INTL(“15-06-2023”, “30-06-2023”, 11) 10 (Sun-Sat weekend)

EDATE Function (Adding Months)

Returns a date that is a specified number of months before or after a start date:

=EDATE(start_date, months)

Example: Add 3 months to 15-06-2023:

=EDATE("15-06-2023", 3) → 15-09-2023

EOMONTH Function (End of Month)

Returns the last day of the month, a specified number of months before or after a start date:

=EOMONTH(start_date, months)

Example: Find the last day of the month 2 months after 15-06-2023:

=EOMONTH("15-06-2023", 2) → 31-08-2023

4. Handling Common Date Issues

Problem 1: Dates Displaying as Numbers

Cause: Cells are formatted as General or Number instead of Date.

Solution:

  1. Select the cells with dates
  2. Right-click and choose “Format Cells”
  3. Select “Custom” category
  4. Enter “dd-mm-yyyy” in the Type field
  5. Click OK

Problem 2: Incorrect Date Calculations

Common causes:

  • Dates entered as text (not recognized as dates)
  • Different date systems (1900 vs 1904)
  • Time components affecting calculations

Solutions:

  • Use DATEVALUE() to convert text to dates: =DATEVALUE(“15-06-2023”)
  • Check Excel’s date system: File → Options → Advanced → “When calculating this workbook” section
  • Use INT() to remove time: =INT(A2)

Problem 3: Two-Digit Year Interpretation

Excel interprets two-digit years differently based on your system settings:

  • Years 00-29 → 2000-2029
  • Years 30-99 → 1930-1999

Best Practice: Always use four-digit years (YYYY) to avoid ambiguity.

5. Practical Applications

Application 1: Project Timelines

Calculate project durations and milestones:

=NETWORKDAYS(start_date, end_date, holidays)

Where holidays is a range containing public holiday dates.

Application 2: Age Calculations

Calculate exact age in years, months, and days:

=DATEDIF(birth_date, TODAY(), "y") & " years, " & DATEDIF(birth_date, TODAY(), "ym") & " months, " & DATEDIF(birth_date, TODAY(), "md") & " days"

Application 3: Payment Terms

Calculate due dates with payment terms:

=WORKDAY(invoice_date, payment_terms)

Where payment_terms is the number of days allowed for payment.

Application 4: Contract Expirations

Calculate days remaining on contracts:

=DATEDIF(TODAY(), contract_end, "d")

6. Excel vs. Google Sheets Date Functions

Functionality Excel Google Sheets Notes
Basic date subtraction =B2-A2 =B2-A2 Identical syntax
Days between dates DATEDIF() DATEDIF() Identical syntax, but Google Sheets documents DATEDIF better
Workday calculations WORKDAY(), NETWORKDAYS() WORKDAY(), NETWORKDAYS() Identical syntax
Adding months EDATE() EDATE() Identical syntax
End of month EOMONTH() EOMONTH() Identical syntax
Custom weekends WORKDAY.INTL(), NETWORKDAYS.INTL() WORKDAY.INTL(), NETWORKDAYS.INTL() Identical syntax
Date formatting Format Cells dialog Format → Number → Custom date Google Sheets uses “dd-mm-yyyy” same as Excel
TODAY function TODAY() TODAY() Both update automatically

7. Best Practices for Date Calculations

  1. Always format dates consistently – Use DD-MM-YYYY throughout your workbook
  2. Use four-digit years – Avoid ambiguity with two-digit years
  3. Document your date sources – Note where dates come from and their time zones
  4. Handle time zones carefully – Convert all dates to a single time zone if working internationally
  5. Validate your dates – Use ISNUMBER() to check if a value is a valid date
  6. Consider leap years – Use DATE() function to handle February 29 correctly
  7. Test edge cases – Check calculations with dates at month/year boundaries
  8. Use named ranges – For frequently used dates like company holidays

8. Learning Resources

For more advanced date calculations, consider these authoritative resources:

9. Frequently Asked Questions

Q: Why does Excel change my DD-MM-YYYY dates to MM-DD-YYYY?

A: This happens when your Windows regional settings use MM-DD-YYYY as the default short date format. To fix:

  1. Go to Windows Settings → Time & Language → Region
  2. Click “Additional date, time & regional settings”
  3. Click “Change date, time, or number formats”
  4. Set Short date format to “dd-MM-yyyy”
  5. Restart Excel

Q: How do I calculate the number of weeks between two dates?

A: Divide the day difference by 7:

=DATEDIF(start_date, end_date, "d")/7

Or for whole weeks:

=INT(DATEDIF(start_date, end_date, "d")/7)

Q: Can I calculate business hours between dates?

A: Yes, but it requires a more complex formula. For 9-5 workdays:

=NETWORKDAYS(start_date, end_date)*9 + IF(NETWORKDAYS(start_date, start_date), MEDIAN(MOD(start_date,1),0.75,0.375),0) - IF(NETWORKDAYS(end_date, end_date), MEDIAN(MOD(end_date,1),0.75,0.375),0)

Q: How do I handle dates before 1900 in Excel?

A: Excel’s date system starts at 1900, so you’ll need to:

  • Store pre-1900 dates as text
  • Use custom functions in VBA
  • Consider alternative tools for historical date calculations

Q: Why does DATEDIF sometimes give wrong results?

A: Common issues include:

  • Start date after end date (returns #NUM! error)
  • Invalid dates (returns #VALUE! error)
  • Time components affecting results (use INT() to remove time)

Leave a Reply

Your email address will not be published. Required fields are marked *