Forum Discussion

SubhasisB's avatar
SubhasisB
Copper Contributor
Dec 08, 2020
Solved

Sumproduct for Dynamic ranges

Dear All, In the attached excel file there are two drop-down box, I want to have the sum total expenses in Q column based on the month selection by the user from drop-down box. Please Help.
  • SergeiBaklan's avatar
    Dec 08, 2020

    SubhasisB 

    That could be

    =SUM(XLOOKUP(O3,$C$2:$N$2,$C3:$N3):XLOOKUP(P3,$C$2:$N$2,$C3:$N3))

    or

    =SUM(INDEX(C4:N4,MATCH(O4,$C$2:$N$2,0)):INDEX(C4:N4,MATCH(P4,$C$2:$N$2,0)))

Resources