Sumproduct with Index / Match or Vlookup not returning array

Ron0813

New Member
Joined
Oct 9, 2019
Messages
5
Hello –
Similar to challenges others have described here, I’m having troubles with using Vlookup Index/Match along with Sumproduct. Those two functions don’t want to return an array in my formula.

Scenario:
I have an invoice table with an Invoice #, Item Code, Sales Price, and Quantity. Each Item Code is associated with a Category which is in a lookup table (not in the Invoice table). I do not want to create a helper column. I am trying to determine revenue for a given Category (For Category, multiply Sales Price by Quantity and sum across all invoices). I have been using the following formula, tables below as well. Invoice table on the left and look up table on the right. Not real data, I’m simplifying.

=SUMPRODUCT($C$2:$C$6,$D$2:$D$6,--(INDEX($G$2:$G$6,MATCH($B$2:$B$6,$F$2:$F$6,0))=$B$11))

I'm supplying the Category as an input (B11) and using True/False return from the Index formula (Array 3 in Sumproduct) to filter on the Category. That is, if it returns 0 the values in that row will not be summed.

Column A
[TABLE="width: 607"]
<tbody>[TR]
[TD]Invoice Number[/TD]
[TD]Item Code[/TD]
[TD]Sales Price Per Unit[/TD]
[TD]Quantity[/TD]
[TD][/TD]
[TD]Item Code[/TD]
[TD]Category[/TD]
[/TR]
[TR]
[TD]00001[/TD]
[TD]1[/TD]
[TD]34.95[/TD]
[TD]11[/TD]
[TD][/TD]
[TD]1[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]00002[/TD]
[TD]1[/TD]
[TD]15.26[/TD]
[TD]7[/TD]
[TD][/TD]
[TD]2[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]00003[/TD]
[TD]3[/TD]
[TD]26.95[/TD]
[TD]23[/TD]
[TD][/TD]
[TD]3[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]00004[/TD]
[TD]3[/TD]
[TD]55.95[/TD]
[TD]30[/TD]
[TD][/TD]
[TD]4[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]00005[/TD]
[TD]5[/TD]
[TD]4.95[/TD]
[TD]11[/TD]
[TD][/TD]
[TD]5[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
That definitely works Marcelo. Thank you for this. I'm not that familiar with Lookup but will go learn about it and make sure this works in my larger dataset/problem. Thank you so much for this. Wish I had posted earlier, I think I spent 8 hours fooling with this. You just saved me a bunch of time.

You are welcome. Glad to help.

M.
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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