excel if in a month, add to a total

Soldato
Joined
1 Jul 2007
Posts
5,392
Had a go at google but not sure if my spreed sheet needs to be better formatted to begin with.

I would like a formulae that would take the date from "invoice date" column and if it's in the month (eg october) use the figure from "invoice amount" column and total it. Any ideas?
 

Sui

Sui

Soldato
Joined
24 Sep 2005
Posts
4,332
Location
Brighton
=IF(month(a1)=month(today()), b1,””)

Something like that might work but I can’t test at the mo because on phone.
 
Soldato
Joined
22 Feb 2014
Posts
2,658
You can either do what Sui has suggested which would probably need an additional column and then sum all the totals at the bottom, or you can use the SUMIF formula
 
Associate
Joined
4 May 2009
Posts
185
Location
Edinburgh, UK
Assume your dates are in Column A, and your costs are in column B:

=SUMPRODUCT( (MONTH(A:A)=10) * (B:B) )

"(MONTH(A2:A6)=10)" creates an array of 1 and 0, it's 1 when the month is October

SUMPRODUCT first multiplies each value of the array created in the above step with values of the array (B2:B6), then it adds them together.
 
Back
Top Bottom