Filtering a Matrix w/ a Vector and Summing/Counting Values in a Column

u8366

New Member
Joined
Mar 6, 2014
Messages
5
Seeking your help to determine an array formula that will filter the values in the first column of a table (multiple rows and columns) with the values in an array and summing or counting specific values in a column of the remaining unfiltered rows.

The data table consists of the following on one tab in the workbook and is a named range, Person_Lookup

[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Weight[/TD]
[TD]Certification[/TD]
[/TR]
[TR]
[TD]Ann[/TD]
[TD]120[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]Bill[/TD]
[TD]180[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Carl[/TD]
[TD]160[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Jose[/TD]
[TD]140[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD]140[/TD]
[TD]No[/TD]
[/TR]
[TR]
[TD]Nancy[/TD]
[TD]135[/TD]
[TD]Yes[/TD]
[/TR]
[TR]
[TD]Rick[/TD]
[TD]175[/TD]
[TD]No[/TD]
[/TR]
</tbody>[/TABLE]














The array value is on another tab, it's a named range and will typically include blank values, Current_Friends.

Ann
Carl
Jose
Rick
blank
blank
blank
...
blank

I'd like an array formula that can sum the weight of the friends listed in the array and another that can count the number of friends with certification.

Is this possible? Thanx a bunch for your insight and experience.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Hi and welcome to Mr Excel Forum

Maybe...

1. Sum of the weights
=SUMPRODUCT(SUMIF(INDEX(Person_Lookup,0,1),Current_Friends,INDEX(Person_Lookup,0,2)))

2. Count with certification (Excel 2007 or higher)
=SUMPRODUCT(COUNTIFS(INDEX(Person_Lookup,0,1),Current_Friends,INDEX(Person_Lookup,0,3),"Yes"))

Hope this helps

M.
 
Upvote 0
Thanx for the prompt response Marcelo. I get a #REF! error when translating this to my need and entering it as an array formula. I don't understand the 0 as the row reference in the INDEX functions.

..... Rick
 
Upvote 0
Thanx for the prompt response Marcelo. I get a #REF! error when translating this to my need and entering it as an array formula. I don't understand the 0 as the row reference in the INDEX functions.

..... Rick

You don't need to confirm the formulas with Ctrl+Shift+Enter

A 0 (zero) as the row reference means all rows - see the help file.

So
INDEX(Person_Lookup,0,1)
returns an array of values corresponding to all rows of the first column (3rd argument = 1) of the named range Person_Lookup.

I tested both formulas and they worked perfectly for me.

M.
 
Upvote 0
Rick,

Please, check the scope of the named ranges.

Both must have Scope = Workbook

M.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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