Text & dates · Medium
How does Excel store dates, and how do you calculate the difference between two dates?
Short answer
Excel stores dates as serial numbers (days since a base date) and times as fractions of a day. Subtracting two dates gives days; multiply by 24 for hours. DATEDIF gives complete years, months or days, and NETWORKDAYS counts working days excluding weekends and listed holidays.
Detailed answer
=B2-A2→ days=(B2-A2)*24→ hours=DATEDIF(A2, B2, "m")→ complete months=NETWORKDAYS(A2, B2, Holidays)=EOMONTH(A2, 0)→ month end
If subtraction gives #VALUE!, the dates are probably text — convert with DATEVALUE or Text to Columns.