WouterS
WouterS

Reputation: 131

Calculate SUM based on date

This is driving me nuts and I don't know what I'm doing wrong.

I have an excel table where my turnover is in with the date of incoming invoices. The date is in format ddmmjjj and is in column C.

I want to calculate my turnover on my dashboard. The total turnover is in column G.

The formula I use is:

=SUM(IF(MONTH(Sheet1!C:C)=2;Sheet!G:G;))

But this formula keeps giving me the total turnover... What am I doing wrong?

Upvotes: 1

Views: 1125

Answers (2)

ttaaoossuu
ttaaoossuu

Reputation: 7884

The formula you are using is correct, however you need to enter it as an array formula (via Ctrl + Shift + Enter).

=SUM(IF(MONTH(Sheet1!C:C)=2,Sheet1!G:G,0))

Upvotes: 2

Phylyp
Phylyp

Reputation: 1689

You need to use the SUMIF function in Excel, which allows you to sum up certain cells if the values in associated cells match a criteria:

SUMIF(range, criteria, [sum_range])

In your case, you'd want to extract the month for the dates in column C into another column (say column X holds the month for the dates in column C), and then:

=SUMIF(Sheet1!X:X, 2, Sheet1!G:G) 

Upvotes: 2

Related Questions