# Excel - Perform a calculation based on a date

Calculations based on a date can be done in Excel worksheets including sums and differences. The data can be passed as a parameter in the date format to the SUMIF operator. The current date or a specific date can be passed to the SUMIF operator along with the cell references in Excel office software. Calculations based on a date can simplify the management of data in worksheets which might otherwise have to be done by complicated methods such as writing programs or macros. The support for date data format in the Excel worksheet is a very useful feature of the office software.

## Issue

I'm trying to calculate 2 columns if the date is more recent than 2009:

```in Column A Column B Column C
5/31/2009 75 35
6/30/2009 40 20
12/2/2010 20 10 ```

I need to take Column B minus Column C if the date is older than 2009. Can someone please provide me the right formula to use?

## Solution

I was able to figure it out. Here's the formula:

`=SUMIF(A2:A4,"<1/1/2010",B2:B4)-SUMIF(A2:A4,"<1/1/2010",C2:C4)`

## Note that

Thanks to joanie for this tip on the forum.
Published by aakai1056. Latest update on May 21, 2012 at 09:03 AM by aakai1056.