Subtract the earlier date from the later date: `=B2-A2`
Use `DATEDIF` for years, months, or days: `=DATEDIF(A2,B2,”d”)`
Use `DATEDIF` for complete years: `=DATEDIF(A2,B2,”y”)`
Use `DATEDIF` for complete months: `=DATEDIF(A2,B2,”m”)`
Use `DATEDIF` for remaining days after months/years: `=DATEDIF(A2,B2,”md”)`
Use `YEARFRAC` for fractional years: `=YEARFRAC(A2,B2)`
Use `NETWORKDAYS` to count weekdays only: `=NETWORKDAYS(A2,B2)`
Use `NETWORKDAYS.INTL` to customize weekend days: `=NETWORKDAYS.INTL(A2,B2,weekend_code)`
Format the result cell as General or Number if the subtraction shows a date
Ensure both cells contain valid Excel dates, not text values
