Page 8 of 16PREVNEXT

Figure out dates by using formulas

Formula to find the number of days between two dates

Callout 1 Formula in the worksheet
Callout 2 Formula result
Callout 3 Formula in the formula bar

Imagine that today is June 9, 2004. Your vacation starts on August 21, 2004, and you want to find out how many days there are until vacation. To do the math, you would type a simple formula into an empty cell (in this example, cell B5):


There are 73 days between the two dates. You can use the dates in a formula because Excel recognizes the values in cells A2 and A3 as dates by their format, and stores them as serial numbers. Excel subtracts the serial number for 6/9/2004 from the serial number for 8/21/2004: 38220 minus 38147 equals 73.

As you type, the equal sign (=) tells Excel that this is a formula. The minus sign operator (-) tells Excel to subtract one value from another. A3 and A2 are the cell references that refer to the values in those cells.

If you wonder later on how you got this result, the formula is visible in the formula bar Formula bar near the top of the worksheet whenever the cell you used is selected. You could also double-click the cell to see the formula in the cell.

Note     The formula result 73 would appear at first in date format, because the values in A2 and A3 are in date format. In the practice session at the end of the lesson you'll see how to reformat the result quickly, so that it appears as a number.

Page 8 of 16PREVNEXT