Home » excel » excel – Using month qualification in SUMIFS statment

# excel – Using month qualification in SUMIFS statment

Questions:

Here’s what I’m looking for….
Trying to Sum the count of worksheet ‘Results 2013’ column G items

``````IF Cell A matches "Canada"
IF Cell E (date) is July
``````

Having trouble with the date portion of the SUMIFS statement below.

``````SUMIFS('Results 2013'!\$G\$2:\$G\$510,'Results 2013'!\$A2:\$A\$510
``````

Example value of “Results 2013″\$E\$480 is

I try this formula, and it provides back “January” which is obviously incorrect.

``````=TEXT(MONTH('Results 2013'!\$E\$480),"mmmm")
``````

However, this formula, results in TRUE or 1

``````=IF(MONTH('Results 2013'!\$E\$480)=7,1,0)
``````

The simplest solution is to add a column `Month` using the `MONTH` function to compute values, and then refer to this new column in `SUMIFS`.

This tests whether the date values in column E fall within the range 7/1/2013 and 7/31/2013. If your dates all fall within 2013, it will work.

``````SUMIFS('Results 2013'!\$G\$2:\$G\$510,'Results 2013'!\$A2:\$A\$510,"=Canada",
'Results 2013'!\$E2:\$E510,">="&DATE(2013,7,1),
'Results 2013'!\$E2:\$E510,"<="&DATE(2013,7,31))
``````

This array formula will work with the more general case of dates falling within any year:

``````=SUM(G2:G510*(A2:A510="Canada")*(MONTH(E2:E510)=7))
``````

``````{SUM(if('Results 2013'!\$A2:\$A\$510="Canada",1,0)*if(MONTH('Results 2013'!\$E2:\$E510)=7,'Results 2013'!\$G\$2:\$G\$510,0))}