0
votes

Headline: I need to make a summary table that, for each row, looks to another sheet, finds the corresponding row based on a criteria (name), and counts the number of instances of a certain value ("P") across several columns.

Specifics: I am making a summary "cover sheet" for an excel doc that summarizes information from other sheets. So, Sheet1 looks like this: Sheet1

....and I want to fill in the "Attendance" column (B:B) on this sheet. I want it to do this by counting the number of P's in another sheet. Sheet2 looks like this: Sheet2

(note that names are not in the same order as on Sheet1)

Desired outcome (which I hand-entered here):
Sheet1 Solution

IMPORTANTLY/Annoyingly: Because of some annoying rules & regulations, I'm not allowed to simply add a helper column to Sheet2 (E:E) (=countif(B2:D2,"P") that I'd then simply import in (=INDEX(Sheet2!E:E, MATCH(A2, Sheet2!A:A, 0)).

I've tried making a hybrid INDEX-COUNTIF & a hybrid COUNTIF-MATCH solution, but to no avail.

My best guess was using COUNTIFS, but when I do COUNTIFS(Sheet2!A:A, A2, Sheet2!B:E,"P")) I get an error message that says, "Array arguments to COUNTIFS are of different size."

Any help would be appreciated!

1

1 Answers

1
votes
=SUMPRODUCT((Sheet2!$A$2:$A$8=A2)*(Sheet2!$B$2:$D$8="P"))

Place the above formula in Sheet1, cell B2 and copy down.

POC