Combining Sumproduct with Vlookup

jlogan223

New Member
Joined
Jul 14, 2015
Messages
2
Hi All,

I am new to this forum, I have done a search but can not see any posts with the same issue, so here goes.

I have multiple documents each with 45+ sheets, 38 of which I need to get data from, I can not edit these sheets but I can add an additional one (summary Page). What I am trying to do is combine a Vlookup and a sum product in to a single cell on a summary page, If there are any easier ways of doing this please feel free to make a suggestion.

My Data:

Row/ColumnIABACADAEAK
PartCurrencyType 1 PriceType 2 PriceType 3 PriceQuantity required
20aGBP1.5036.251
21abEUR410.52
22bUSD3.303.3071
23cgGBP12.901001560
24efGBP0.900.85124
..............
..............
..............
100............

<tbody>
</tbody>


What I need to be able to do is have one cell in a summary page that sum the following up:

What I need is a single formula for Type 1 price per sheet, so I need to do is:

multiple the quantity * the unit price *the currency (which needs to be looked up in another sheet),
then give me a sum for the complete sheet for Type 1 price in a single cell on a summary page, then the same for Type 2 and Type 3

so something like (but not) this:

Sumproduct=((AK20:AK100),AC20:AC100),Vlookup(AB20:AB100,'LOOKUPSHEET'!A1:B40,2,FALSE))

I hope this makes sense, If I have missed anything out please let me know.

Thanks,
Justin
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Assuming that each currency that occurs in Column AB is listed in the lookup table, try...

=SUMPRODUCT(AK20:AK100,AC20:AC100,SUMIF(LOOKUPSHEET!A1:A40,AB20:AB100,LOOKUPSHEET!B1:B40))

Hope this helps!
 
Upvote 0
Assuming that each currency that occurs in Column AB is listed in the lookup table, try...

=SUMPRODUCT(AK20:AK100,AC20:AC100,SUMIF(LOOKUPSHEET!A1:A40,AB20:AB100,LOOKUPSHEET!B1:B40))

Hope this helps!


Thanks Domenic, That is almost exactly what I am looking for. I have however identified one issue, if the Currency appears more than once in the lookup table, it adds the conversation rates together, ie:

CountryCurrency CodeConversion rate
GermanyEUR0.833
Great Britain GBP1
United StatesUSD0.571
FranceEUR0.833

<tbody>
</tbody>


This would then give me a multiplier of 1.66666, is there anyway around this, so that it finds the EUR value then just takes that one value instead of finding the rest and adding them up?

Regards,
Justin
 
Upvote 0
In that case, try...

=SUMPRODUCT(AK20:AK100,AC20:AC100,SUMIF(LOOKUPSHEET!A1:A40,AB20:AB100,LOOKUPSHEET!B1:B40)/COUNTIF(LOOKUPSHEET!A1:A40,AB20:AB100))

However, if you sort your lookup table by currency and in ascending order, the LOOKUP function can be used instead of SUMIF/COUNTIF. Using LOOKUP should be more efficient. So, for example, sort your lookup table as follows...

CountryCurrency CodeConversion rate
FranceEUR0.833
GermanyEUR0.833
Great BritainGBP1
United StatesUSD0.571

<tbody>
</tbody>

Then, if each item that occurs in Column AB is listed in the lookup table, try...

=SUMPRODUCT(AK20:AK100,AC20:AC100,LOOKUP(AB20:AB100,LOOKUPSHEET!B1:C40))

Otherwise, try...

=SUM(IF(ISNUMBER(MATCH(AB20:AB100,LOOKUPSHEET!B1:B40,0)),(AK20:AK100)*(AC20:AC100)*(LOOKUP(AB20:AB100,LOOKUPSHEET!B1:C40))))

...which needs to be confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,221,583
Messages
6,160,638
Members
451,661
Latest member
hamdan17

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