# excel if in a month, add to a total

Discussion in 'Windows & Other Software' started by ash_scotland88, Nov 12, 2019.

1. ash_scotland88

# Posts: 5,097

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?

2. Sui

# Location: Brighton

=IF(month(a1)=month(today()), b1,””)

Something like that might work but I can’t test at the mo because on phone.

3. MassiveJim

# Posts: 1,880

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

4. Devrij

# Location: Bath

SUMIF would have been my preference.

5. GilesGuthrie

# 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.