comare totals between tables one to many relationship

jrg24

New Member
Joined
Aug 6, 2010
Messages
49
Hello All.
I am sure this is an easy thing but I cannot seem to wrap my head around it. I am also sure this has been asked before but I am not certain how to articulate it in a search.

I have two tables, Table 1 is a list of invoices that contains the total cost related to the invoice (This is the one side). Table 2 lists each individual cost line broken out (each cost is a separate record). Invoice number is the related field. What I would like to do is compare the sum of the individual cost lines in table 2 to the total cost in table 1 and return all records from table 2 that do not add up to the value on table 1.


Thanks for any help you can provide.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Maybe something like this, using the SUMPRODUCT() function?

ABCDEFGHI
1Invoice Amount Invoice
2A123 $ 123.45 A123 $ 100.00 Perfect match for A123
3B124 $ 567.89 A123 $ 23.45 No Match for B124
4C888 $ 1,000.00 B124 $ 500.00 Perfect match for C888
5B124 $ 67.00
6C888 $ 250.00
7C888 $ 250.00
8C888 $ 250.00
9C888 $ 250.00

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
I2=IF( B2 <> SUMPRODUCT(( F2:F9) * ( E2:E9 = A2)), "No Match for ", "Perfect match for ") & A2
I3=IF( B3 <> SUMPRODUCT(( F3:F10) * ( E3:E10 = A3)), "No Match for ", "Perfect match for ") & A3
I4=IF( B4 <> SUMPRODUCT(( F4:F11) * ( E4:E11 = A4)), "No Match for ", "Perfect match for ") & A4

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,221,777
Messages
6,161,871
Members
451,727
Latest member
tyedye4

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