Consulting

Results 1 to 5 of 5

Thread: Sumproducts problem

  1. #1
    VBAX Contributor
    Joined
    Sep 2007
    Posts
    119
    Location

    Sumproducts problem

    Hi,

    I am using sumproduct to get total for previous and current month from a datasheet. It did not worked as expected in C15 and C16.

    Please help.
    Attached Files Attached Files

  2. #2
    Hello,

    what results do you expect to see in C15 & C16?

    If in C15 you expect 340 then try

    =SUMPRODUCT(--(B5:B10>=EOMONTH(B2,-2)+1),(--(B5:B10<=EOMONTH(B2,-1))*C5:C10))
    ---------------
    Hope this helps
    ---------------

    Have been away for a very long time,
    but am popping back again (now and then).

  3. #3
    VBAX Contributor
    Joined
    Sep 2007
    Posts
    119
    Location
    Hi onlyadrafter,

    You are great!

    I also expect C16 to have sum of current month report per B2. I have using MONTH function in sumproduct but its total with all the same month inclusive previous year date. The data contained transactions since 2013. Can explain how to get around with EOMONTH function in your solution?


    Thanks

  4. #4
    Hello,

    For the current month, use

    =SUMPRODUCT(--(B5:B10>=EOMONTH(B2,-1)+1),(--(B5:B10<=EOMONTH(B2,0))*C5:C10))

    should give an answer of 0 for your data.
    ---------------
    Hope this helps
    ---------------

    Have been away for a very long time,
    but am popping back again (now and then).

  5. #5
    VBAX Contributor
    Joined
    Sep 2007
    Posts
    119
    Location
    Thanks again onlyadrafter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •