1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

excel if in a month, add to a total

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

  1. ash_scotland88


    Joined: Jul 1, 2007

    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


    Joined: Sep 24, 2005

    Posts: 3,085

    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

    Wise Guy

    Joined: Feb 22, 2014

    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


    Joined: Jul 23, 2009

    Posts: 13,198

    Location: Bath

    SUMIF would have been my preference.
  5. GilesGuthrie


    Joined: May 4, 2009

    Posts: 82

    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.