របៀបគណនាចំនួនថ្ងៃរវាងកាលបរិច្ឆេទពីរក្នុង Excel - How to Calculate Days Between Two Dates in Excel (Video in Khmer)

Learn how to calculate the number of days between two dates in Excel step-by-step using date subtraction and the DAYS function.

Advertisement

Hello everyone! In today's video tutorial, you will learn how to calculate the number of days between two dates in Excel step-by-step.

Whether you are calculating project durations, rental periods, or employment days, Excel provides two easy methods to find the exact day count.

🛠️ Free Online Tool: Need to calculate working days online? Use our Free Working Days Calculator Tool to compute dates, weekends, and holidays instantly!


🛠️ Method 1: Simple Date Subtraction Formula (End Date - Start Date)

Excel stores dates as sequential serial numbers, so you can subtract the Start Date from the End Date directly:

1. Exclude the End Date (Difference in Days):

If your Start Date is in cell A2 and End Date is in cell B2:

=B2 - A2

Example: 2026-01-05 minus 2026-01-01 = 4 days.

2. Include Both Start and End Dates (Total Calendar Days):

If you want to count both the start day and the end day (inclusive count):

=B2 - A2 + 1

Example: 2026-01-05 minus 2026-01-01 + 1 = 5 total days.


Advertisement

🛠️ Method 2: Using the DAYS() Function

Excel has a built-in DAYS function designed specifically for calculating date differences.

1. Exclude the End Date:

=DAYS(B2, A2)

2. Include Both Start and End Dates:

=DAYS(B2, A2) + 1

⚠️ Important: In the DAYS(end_date, start_date) function, the End Date comes first!


💡 Pro Tips

  1. Avoid Negative Days: If your result shows a negative number (e.g., -5), double-check your formula parameters. DAYS() requires the End Date first: =DAYS(end_date, start_date).
  2. Exclude Weekends & Holidays (NETWORKDAYS): If you only want to count working business days (excluding Saturdays, Sundays, and public holidays), use:
    =NETWORKDAYS(A2, B2)
    
  3. Fix Date Cell Formatting: If your formula result shows as a date (like 01/05/1900) instead of a number, right-click the cell ➔ select Format Cells ➔ change category to General or Number.
Found this tutorial helpful? Share it with colleagues:
Advertisement