Lookup multiple instances of the same value in a range

Mojoswoptops

New Member
Joined
Aug 23, 2017
Messages
4
Hi all, I'm trying to lookup every instance of a value (Vendor Name) and return the total sum of each of these rows value from another column (Retention Held).

For example - When ABC Contractor is selected in cell R4, I want every instance of ABC Contractors on the Retention Register to be picked up, and the Retention Held to add up, with the sum of the values from column P for each matching instance from column K, to appear in cell S4.

As you can see, I have tried a few INDEX functions, combined with SMALL functions which I have found on this forum and others, but nothing seems to be working.

I have no issue with doing this in VBA if it's more simple.

Thanks very much!


Excel 2016 (Windows) 32 bit
KLMNOPQRS
1
2Retention Register
3VendorInvoice No.Code Contract AmountRetention HeldContractorTotal
4ABC Contractors00002 $ 110,000.00 $ 500.00ABC Contractors1500
5DEF CONTRACTORSDEF0001 $ 80,000.00 $ 2,500.00
6ABC Contractors0003 $ 80,000.00 $ 1,500.00
7ABC Contractors0003 $ 80,000.00 $ 1,500.00
8HIJ Supplier0003 $ 120,000.00 $ 6,000.00
9
10
11
12

<tbody>
</tbody>
Payment Certificate

Worksheet Formulas
CellFormula
S4=INDEX(RetentionRegister, SMALL(IF(L4:L54=R4,ROW(L4:L54)),ROW(1:1)),5)

<tbody>
</tbody>

<tbody>
</tbody>

Workbook Defined Names
NameRefers To
RetentionRegister='Payment Certificate'!$L$4:$P$54

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,214,520
Messages
6,120,008
Members
448,935
Latest member
ijat

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