If you’re only interested in determining the number of days between two dates, the calculation is very simple. All you have to do is subtract the two cells. That is, if the first date is in cell A2 and the second one in cell B2, you can use the basic formula
= B2 – A2
as shown in the screenshot below. (Click any image for a larger view.)
If you’re trying to construct a basic formula that you can use for an entire list of date calculations, you might want to embellish this just a bit. In long lists of data, it’s possible that the larger of two dates in any row might reside in either column, and the basic formula above could end up giving a negative answer for some of these rows.
If you want to make sure that the number of days is always positive, you can modify this formula with the ABS function. This function will return the absolute value of any difference between the two dates so you won’t have to worry about negative numbers appearing in your results. The modified formula would appear as
= ABS(B3 – A3)
and an example of this is shown below.