Finding One Result Instead of Multiple

eforti

Board Regular
Joined
Aug 15, 2005
Messages
222
Hello All,
I'm using the below code to return data from a dynamically linked file. The issue I'm running into is that it is only returning data from the first instance of the criteria that it finds. This is how I designed it so that makes sense. But I find that I now have a need to sum the results if multiple instances of the search criteria exist.

Example: The code below is looking for FORD, and if it finds it the value is returned. But if FORD is listed twice in my search range I'd like it to add the resulting values in the returned field.

I feel like this is just changing indirect to sumif, but can't seem to figure out how to get it to work.

=IF($I9="","",IF(ISERROR(VLOOKUP($I9,INDIRECT(CONCATENATE(Reference!$C$6,"$B$4:$O$2000")),5,FALSE)*$V9),0,VLOOKUP($I9,INDIRECT(CONCATENATE(Reference!$C$6,"$B$4:$O$2000")),5,FALSE)*$V9))

Thanks in advance for any help.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Try using the SUMPRODUCT function for this. Like:

=SUMPRODUCT(--(lookupvalue=listtomatch)*(listofvalues))
 
Upvote 0
Glenn,
Thanks for the response. I guess my confusion is stemming from how to integrate the required feature (in this case sumproduct) into my existing code. Again, it is dynamically linking based on other data. I can't do just the sumproduct formula.
 
Upvote 0
At a guess, maybe:

=SUMPRODUCT(--($I9=INDIRECT(CONCATENATE(Reference!$C$6,"$B$4:$B$2000")))*(INDIRECT(CONCATENATE(Reference!$C$6,"$F$4:$F$2000"))))
 
Upvote 0

Forum statistics

Threads
1,224,548
Messages
6,179,445
Members
452,915
Latest member
hannnahheileen

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