# Excel: Mathematical operations on date and time

You can perform such arithmetic operations as addition or subtraction not only on numbers but also on dates. In this lesson, I will show you a few examples of how you can do it.

## Calculating the number of days between two dates

### Example 1:

If you want to perform addition or subtraction on dates, first, you need to save them in separate cells. Let it be cell **A1** and cell **A2.**

**A1** = January 10, 2014 15:15:00

**A2** = February 12, 2014

When a date includes time other than midnight (24:00:00 is the default time) then the number of days that are returned will be reduced by one. The following examples show ways to ignore time and use only the date part.

### Example 2:

= DAYS(**A2**, **A1**)

returns **33.**

In this example, the** DAYS** function returns the number of days between two dates.

**Example 3:**

returns **33.**

The date and time were rounded to the nearest integer (in this case, it means getting rid of the time part, so only a day will be remembered. The time will be set to the default value, which is 24:00:00).

## Adding and subtracting days

Let's use the example from the previous exercise.

### Example 4:

**A1** = January 10, 2014

If you want to see what date will be 33 days after the date of **January 10, 2014**, you can add to that date the number 33.

Look at the following formula:

= **A1** + 33

The result will be **February 12, 2014**. You can also check what date was 33 days before the date of **February 12, 2013**.

**A2** = February 12, 2014

=** A2** - 33

The result is **January 10, 2014**.