Summing one column if two other columns' values appear in other sh

G

Guest

1. One sheet (Sheet1) contains a valid list of task numbers in column A.

2. Another sheet (Sheet2) contains a valid list of people's names in column
A.

3. Another sheet (Sheet3) contains:
a. Task number in column B.
b. Person's name in column D.
c. Number of hours worked in column F.

4. I need to sum the hours worked (Sheet3, column F) if the task number
(Sheet3 column B) appears in Sheet1, column A AND the person's name (Sheet3,
column D) appears in Sheet2, column A. I need the sum to appear in column J
in Sheet2.

Thanks for your help!
 
M

Max

Assuming:

Task#s listed within A2:A20 in Sheet1,
Task#s listed within B2:B100 in Sheet3,
Names listed within D2:D100 in Sheet3,
Hours worked within F2:F100 in Sheet3

In Sheet2,
Names are listed in A2 down

Put in J2:
=SUMPRODUCT(ISNUMBER(MATCH(Sheet3!$B$2:$B$100,Sheet1!$A$2:$A$20,0))*(Sheet3!
$D$2:$D$100=A2),(Sheet3!$F$2:$F$100))
Copy down

Adapt the ranges to suit ..
(note that we can't use entire col refs in SUMPRODUCT)
 
G

Guest

Max,
Thanks so much for your help! It worked perfectly! I had been struggling
with this for days. Thanks again!!
 
G

Guest

Glad it worked, and thanks for the feedback !

Btw, although this doesn't affect the formula's return
the parens around the last term: .. ,(Sheet3!$F$2:$F$100))
wasn't necessary. My error, just detected.

It should read as just: .. ,Sheet3!$F$2:$F$100)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top