from 21-Mar to 22-Mar, excel sees it as 2 days
In Excel, subtracting these two dates gives an answer of 1 which what Project would give with those exact dates. However, the key thing to remember is the time component. These two images from Project show the same task, the only difference is how the dates are displayed. The task has a duration of 2 days because it spans 16 working hours and a "day" is defined as 8 hours.
In both Excel and Project, dates are stored as numbers (double) where the integer component is the day and the decimal part is the time. For example, Mar-21 8:00
is stored as 45372.3333333333
. In Excel, unless a time component is explicitly entered, the dates have no time part (e.g. the time is midnight), subtracting one date from another gives the number of calendar days between them.
In Project, date math (adding, subtracting) is almost always* done using the calendars that define which hours are working. This is at the heart of what Project does and is not easily replicated in Excel.
** Elapsed durations are the exception--elapsed durations ignore working time and are calculated as in Excel.