SUMIFS Using VLOOKUP Range

MPierce486

New Member
Joined
Jun 8, 2012
Messages
23
Office Version
  1. 2016
I am trying to SUMIFS using multiple criteria, but one of the criteria is dependent on another table. See below.

1644606095510.png
1644606160925.png


I am trying to sum up all amounts with a "111" account number AND where the "Code" is equal to "Equity". The first part is easy by using =SUMIF(A3:A8,111,C3:C8). However, I'm unable to a VLOOKUP for the next part since I cannot select a range as the lookup_value. Using =SUMIF(VLOOKUP(B3:B8,E3:F7,2),Equity,C3:C8) does not work.

I have tried using SUMPRODUCT or SUMIF along with INDEX & MATCH, but no success yet. Any help is appreciated. Thank you!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
MrExcelPlayground6.xlsx
ABCDEF
2AccountCodeAmountcodeclass
3111423154546228Equity
411137561856271Equity
51112713318375Fixed Income
6222423155962423Cash
72222281863576Equity
822257615632
9
10111Equity3318Office 365
11
12111Equity3318Older than 365
Sheet31
Cell Formulas
RangeFormula
C10C10=SUM(FILTER(C3:C8,(A3:A8=A10)*(VLOOKUP(B3:B8,E3:F7,2,FALSE)=B10)))
C12C12=SUMPRODUCT(C3:C8,--(A3:A8=A12),--(VLOOKUP(B3:B8,E3:F7,2,FALSE)=B12))
 
Upvote 0
MrExcelPlayground6.xlsx
ABCDEF
2AccountCodeAmountcodeclass
3111423154546228Equity
411137561856271Equity
51112713318375Fixed Income
6222423155962423Cash
72222281863576Equity
822257615632
9
10111Equity3318Office 365
11
12111Equity3318Older than 365
Sheet31
Cell Formulas
RangeFormula
C10C10=SUM(FILTER(C3:C8,(A3:A8=A10)*(VLOOKUP(B3:B8,E3:F7,2,FALSE)=B10)))
C12C12=SUMPRODUCT(C3:C8,--(A3:A8=A12),--(VLOOKUP(B3:B8,E3:F7,2,FALSE)=B12))

I get a #VALUE error in the VLOOKUP due to the B3:B8 reference.
 
Upvote 0
Does this work?
MrExcelPlayground6.xlsx
ABCDEF
2AccountCodeAmountcodeclass
3111423154546228Equity
411137561856271Equity
51112713318375Fixed Income
6222423155962423Cash
72222281863576Equity
822257615632
9
10111Equity3318Office 365
11
12111Equity3318Older than 365
13
14111Equity3318Another Thing
Sheet31
Cell Formulas
RangeFormula
C10C10=SUM(FILTER(C3:C8,(A3:A8=A10)*(VLOOKUP(B3:B8,E3:F7,2,FALSE)=B10)))
C12C12=SUMPRODUCT(C3:C8,--(A3:A8=A12),--(VLOOKUP(B3:B8,E3:F7,2,FALSE)=B12))
C14C14=SUMPRODUCT(C3:C8,--(A3:A8=A12),--(INDEX(F3:F7,MATCH(B3:B8,E3:E7,0))=B14))
 
Upvote 0
Does this work?
MrExcelPlayground6.xlsx
ABCDEF
2AccountCodeAmountcodeclass
3111423154546228Equity
411137561856271Equity
51112713318375Fixed Income
6222423155962423Cash
72222281863576Equity
822257615632
9
10111Equity3318Office 365
11
12111Equity3318Older than 365
13
14111Equity3318Another Thing
Sheet31
Cell Formulas
RangeFormula
C10C10=SUM(FILTER(C3:C8,(A3:A8=A10)*(VLOOKUP(B3:B8,E3:F7,2,FALSE)=B10)))
C12C12=SUMPRODUCT(C3:C8,--(A3:A8=A12),--(VLOOKUP(B3:B8,E3:F7,2,FALSE)=B12))
C14C14=SUMPRODUCT(C3:C8,--(A3:A8=A12),--(INDEX(F3:F7,MATCH(B3:B8,E3:E7,0))=B14))
The reference in MATCH returns #VALUE. Aren't only supposed to have a single "lookup_value" in MATCH and VLOOKUP?
 
Upvote 0
You can do a helper column. Put the vlookup in column D and use that in the sumproduct. I guess you are running an old excel.
 
Upvote 0
Solution
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
Whoops, it's 2016. Just updated the account details.
 
Upvote 0

Forum statistics

Threads
1,214,973
Messages
6,122,534
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top