How to sum a column based on criteria from current and other tables?

Issey

New Member
Joined
May 18, 2018
Messages
5
Hello,

I have been scratching my head for a week on this question.

I have two tables
- Table 1 - it contains a list of people, the problem they worked on, and how many interactions they had on the problem.
- Table 2 - it contains a list of people who owned and solved a problem.

A problem is C followed by a number

For example,
Table 1, R had in total 7 interactions on 4 problems (C1 =2 , C5 =1, C3 =1, and C4 = 3)
Table 2, R owned and solved 1 problem (C3)

OwnerProblemInteractionOwnerProblem
RC12RC3
KC23AC1
PC26BC4
RC51KC2
KC17PC5
RC31CC6
RC43DC7
PC17PC8

<colgroup><col width="64" span="7" style="width:48pt"> </colgroup><tbody>
</tbody>

What I'm trying to write is a formula that gives me
- the number of interactions a owner did have (Table 1) on problems he didn't solve (Table 2).

In the example above, the formula will give me 6 (C1 =2 as it was owned by K , C5 =1 - owned by P, and C4 = 3 - owned by B)

I have tried to use SUMIFS with arrays, combination of SUM and IFS with arrays, etc. without success.

Any pointer, direction will be really helpful.

Thank you.
Issey
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
try


Excel 2013/2016
ABCDEFGHI
1OwnerProblemInteractionOwnerProblemOwnerInteraction
2RC12RC3R6
3KC23AC1
4PC26BC4
5RC51KC2
6KC17PC5
7RC31CC6
8RC43DC7
9PC17PC8
Sheet1
Cell Formulas
RangeFormula
I2=SUMIF(A2:A9,H2,C2:C9)-IFERROR(VLOOKUP(VLOOKUP(H2,E2:F9,2,0),B2:C9,2,0),0)
 
Upvote 0
Hello AlanY,

Thank you for your quick help!!!

I'm going to review this formula and try to understand the logic behind it.

I have read to use VLOOKUP, the columns need to be ordered, is it right?

Cheers,
Issey
 
Upvote 0
you're welcome.

that vlookup()s in the formula don't needed to be sorted. the ,0 at the end to force an exact match and the iferror() trap down the no match.

the first part, sumif() is to add up all the interactions

the second part of lookup()s, first to find if the problem been solved, VLOOKUP(H2,E2:F9,2,0) to get the problem reference, in this example C3.

then the outer lookup() use C3 to look for the no of interactions in B2:C9 and to be taken away from the total
 
Last edited:
Upvote 0
Hello AlanY,

I was wondering why I was looking at arrays, and it looks I didn't give the correct problem description.

The problem I originally gave was when an owner solved only one problem.

In the table 2, R only solved C3.

OwnerProblemInteractionOwnerProblem
RC12RC3
KC23AC1
PC26BC4
RC51KC2
KC17PC5
RC31CC6
RC43DC7
PC17PC8

<tbody>
</tbody>
But an owner can actually solve multiple problems.
For example, now, R solved two problems (C3 and C4), so the number of interactions should be 3.

OwnerProblemInteractionOwnerProblem
RC12RC3
KC23AC1
PC26RC4
RC51KC2
KC17PC5
RC31CC6
RC43DC7
PC17P

Z
C8

C10

<tbody>
</tbody>

Any pointers that could help me?

Cheers,
Rithy
 
Upvote 0

Book1
ABCDEFGH
1OwnerProblemInteractionOwnerProblemOwnerInteraction
2RC12RC3R3
3KC23AC1
4PC26RC4
5RC51KC2
6KC17PC5
7RC31CC6
8RC43DC7
9PC17PC8
10ZC10
11
Data


In H2 control+shift+enter, not just enter:

=SUM(IF($A$2:$A$9=G2,IF(ISNA(MATCH($B$2:$B$9,IF($E$2:$E$10=G2,$F$2:$F$10),0)),$C$2:$C$9)))
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,580
Members
448,972
Latest member
Shantanu2024

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