+ Reply to Thread
Results 1 to 6 of 6

Thread: Combine SUMPRODUCT with SUMIF

  1. #1
    Registered User
    Join Date
    08-18-2011
    Location
    Auckland, New Zealand
    MS-Off Ver
    Excel 2003
    Posts
    1

    Question Combine SUMPRODUCT with SUMIF

    I am trying to write a formula to combine sumproduct and sumif to get weighted average price that is calculated based on dates selected.

    Is it possible?

    Thanks...
    Attached Files Attached Files

  2. #2
    Forum Guru jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    San Antonio, TX
    MS-Off Ver
    Excel 2007
    Posts
    2,573

    Re: Trying to combine SUMPRODUCT with SUMIF

    Hello & Welcome to the Board,

    Try this...

    C31 =AVERAGEIFS($B$2:$B$26,$A$2:$A$26,">="&A31,$A$2:$A$26,"<="&B31)
    C32 =AVERAGEIFS($B$2:$B$26,$A$2:$A$26,">="&A32)
    HTH
    Regards, Jeff

    If you like the answer(s) provided, why not add some reputation by clicking the * below
    Please use [ Code ] tags when posting [ /Code ]
    Please view/read the Forum rules --- How to mark a thread as solved

  3. #3
    Valued Forum Contributor MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    5,285

    Re: Trying to combine SUMPRODUCT with SUMIF

    Hello sahjid and welcome to the forum,

    See if the attached pivot table doesn't get what you want.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * below to say thanks.

  4. #4
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,788

    Re: Combine SUMPRODUCT with SUMIF

    averageifs is not in excel 2003
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Forum Guru jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    San Antonio, TX
    MS-Off Ver
    Excel 2007
    Posts
    2,573

    Re: Combine SUMPRODUCT with SUMIF

    You are correct, but the attachment is 2007.
    HTH
    Regards, Jeff

    If you like the answer(s) provided, why not add some reputation by clicking the * below
    Please use [ Code ] tags when posting [ /Code ]
    Please view/read the Forum rules --- How to mark a thread as solved

  6. #6
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,772

    Re: Combine SUMPRODUCT with SUMIF

    If you want volume-weighted price, I think ...

    =SUMPRODUCT(($A$5:$A$26>=A31) * ($A$5:$A$26<=B31), $B$5:$B$26, $C$5:$C$26) / SUMPRODUCT(($A$5:$A$26>=A31) * ($A$5:$A$26<=B31), $C$5:$C$26)
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0