• Variable Range w/in Sumproduct (2002)

    Author
    Topic
    #410339

    Within a sumproduct formula, is there any way automate a variable range of an array based on changing start and end dates in other cells?

    For instance, see the attachment for an example.

    Viewing 5 reply threads
    Author
    Replies
    • #881208

      Probably a better way…..

      =SUMPRODUCT(–(A2:A21>=F6),–(A2:A21=F6),–(A2:A21<=F7),B2:B21)

    • #881209

      Probably a better way…..

      =SUMPRODUCT(–(A2:A21>=F6),–(A2:A21=F6),–(A2:A21<=F7),B2:B21)

    • #881237

      Or, alternatively:
      In E11: =SUMPRODUCT((A2:A21>=F6)*(A2:A21=F6)*(A2:A21<=F7)*Volume)

    • #881238

      Or, alternatively:
      In E11: =SUMPRODUCT((A2:A21>=F6)*(A2:A21=F6)*(A2:A21<=F7)*Volume)

    • #881253

      =SUMPRODUCT(–(Date>=F6),–(Date=F6),–(Date<=F7),Volume)

      Better, if it's the case that the data area is sorted in ascending order on the date column…

      G6:

      =MATCH(F6,Date)+(LOOKUP(F6,Date)F6)

      G7:

      =MATCH(F7,Date)

      The weighted average formula then becomes:

      =SUMPRODUCT(INDEX(Volume,G6):INDEX(Volume,G7),INDEX(TAT,G6):INDEX(TAT,G7)/SUM(INDEX(Volume,G6):INDEX(Volume,G7)))

    • #881254

      =SUMPRODUCT(–(Date>=F6),–(Date=F6),–(Date<=F7),Volume)

      Better, if it's the case that the data area is sorted in ascending order on the date column…

      G6:

      =MATCH(F6,Date)+(LOOKUP(F6,Date)F6)

      G7:

      =MATCH(F7,Date)

      The weighted average formula then becomes:

      =SUMPRODUCT(INDEX(Volume,G6):INDEX(Volume,G7),INDEX(TAT,G6):INDEX(TAT,G7)/SUM(INDEX(Volume,G6):INDEX(Volume,G7)))

    Viewing 5 reply threads
    Reply To: Variable Range w/in Sumproduct (2002)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: