Help to write formula to extract Sum Pairs

tomnyc

New Member
Joined
Mar 17, 2013
Messages
3
Hello,

I have a sheet that I need to find all matching pairs that net down to zero based on 2 quantity criteria. I attached a sample sheet below (Column A = Account Key, Column B = Rec Del, Column C = Calculated USD, and Column D = contractual USD).

I've made a unique key by concatenating 2 different columns, and want to 1) remove all Account keys that contain only "Del" or only "Rec" in column B, 2) from the remaining set, find all keys that contain both "Del" and "Rec" in column B such that they Net down to Zero based on Column C value, and Net down to Zero based on Column D value. Also, Column C and Column D should equal and net zero if using a negative value for "Del".

The amounts are in gross value, so you can assign a negative value for say all "Del" items in Column B. I'm trying to work the sumIf function but not sure I'm capturing everything. Can anyone help? Would be greatly appreciated. It shouldn't be too difficult for an experienced exceler. I don't think a macro is needed for this (if it is, I would need to give you all the column labels). My Entire sheet has 10 columns, with over 10,000 rows of data. I would appreciate any help you can provide. I have to create this report for tomorrow :/

AccountKey</SPAN>
Rec Del</SPAN>
Calculated USD </SPAN>
Contractual Usd </SPAN>
001055102OPERATIONS CONTROL ACCOUNTS</SPAN>
Del</SPAN>
54,754.81 </SPAN>
- </SPAN>
001092915OPERATIONS CONTROL ACCOUNTS</SPAN>
Del</SPAN>
- </SPAN>
001317205NORTHERN TRUST</SPAN>
Del</SPAN>
23,577.52 </SPAN>
23,577.00 </SPAN>
00143M380DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Del</SPAN>
80.72 </SPAN>
80.00 </SPAN>
00176LDN8CORPORATE CLEARANCE UNMATCHED</SPAN>
Rec</SPAN>
- </SPAN>
- </SPAN>
00176LDN8NATIONAL FINANCIAL SVCS CORP</SPAN>
Del</SPAN>
13,365.00 </SPAN>
13,365.00 </SPAN>
001940915OPERATIONS CONTROL ACCOUNTS</SPAN>
Del</SPAN>
- </SPAN>
0020A2UX8UNALLOCATED</SPAN>
Del</SPAN>
1,247,171.88 </SPAN>
1,247,171.00 </SPAN>
002920AC0WELLS CAPITAL MGMT</SPAN>
Del</SPAN>
- </SPAN>
003725926OPERATIONS CONTROL ACCOUNTS</SPAN>
Del</SPAN>
- </SPAN>
003725926CLEARBRIDGE ADVISORS, LLC</SPAN>
Rec</SPAN>
201,917.00 </SPAN>
00386SAK8INTERCOMPANY ACCOUNTS</SPAN>
Del</SPAN>
201,916.67 </SPAN>
004239109OPERATIONS CONTROL ACCOUNTS</SPAN>
Del</SPAN>
37,905.04 </SPAN>
37,905.04 </SPAN>
004341AV5DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Del</SPAN>
6.75 </SPAN>
6.00 </SPAN>
004341AY9DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Del</SPAN>
0.01 </SPAN>
- </SPAN>
004994919OFFICE TO OFFICE HEDGE REPOS</SPAN>
Del</SPAN>
9,888.02 </SPAN>
- </SPAN>
004994919OFFICE TO OFFICE HEDGE REPOS</SPAN>
Rec</SPAN>
9,888.02 </SPAN>
- </SPAN>
00507K103LEGAL & GENERAL INV MGMT LTD</SPAN>
Rec</SPAN>
62,001.57 </SPAN>
62,001.00 </SPAN>
00512R200DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Del</SPAN>
1.00 </SPAN>
1.00 </SPAN>
00547Q201DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Del</SPAN>
13.12 </SPAN>
13.00 </SPAN>
00547Q201DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Rec</SPAN>
3.71 </SPAN>
3.00 </SPAN>
00547Q201NOT AVAILABLE</SPAN>
Del</SPAN>
3.71 </SPAN>
- </SPAN>
005614DS8DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Del</SPAN>
30,000.00 </SPAN>
30,000.00 </SPAN>
00652G105DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Del</SPAN>
138.20 </SPAN>
137.00 </SPAN>
00652G105DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Del</SPAN>
0.72 </SPAN>
- </SPAN>
00652G105DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Rec</SPAN>
45.00 </SPAN>
45.00 </SPAN>
00652G105DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Rec</SPAN>
2.22 </SPAN>
1.00 </SPAN>
00652G105DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Rec</SPAN>
91.68 </SPAN>
91.00 </SPAN>
00652G105NOT AVAILABLE</SPAN>
Del</SPAN>
150.00 </SPAN>
- </SPAN>
00652G105NOT AVAILABLE</SPAN>
Rec</SPAN>
208.20 </SPAN>
- </SPAN>
00687U103NOT AVAILABLE</SPAN>
Del</SPAN>
1,066.00 </SPAN>
- </SPAN>
006ESC9F6DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Del</SPAN>
97.50 </SPAN>
97.00 </SPAN>
00709P108BTG PACTUAL US CAPITAL LLC</SPAN>
Del</SPAN>
379,975.00 </SPAN>
379,975.00 </SPAN>
00752K105DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Del</SPAN>
152,722.92 </SPAN>
152,722.00 </SPAN>
00752K105DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Rec</SPAN>
97,166.29 </SPAN>
208,069.00 </SPAN>
00752K105DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Rec</SPAN>
44,544.64 </SPAN>
44,544.00 </SPAN>
00754V109DEFAULT FOR CPI IIG/IFG ACCTS</SPAN>
Rec</SPAN>
2,000.00 </SPAN>
2,000.00 </SPAN>

<TBODY>
</TBODY>
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hi, welcome to the board.

Just to be absolutely clear, can you explain please, for your posted sample data, exactly which rows can be netted off to zero ?
 
Upvote 0
Hi,

Column C & D, Calculated USD( column C)should net down to zero if you take a negative value for "Del". Contractual USD(column D) should equal Column C and this should net down too. If they don't match, that's ok. Just need to know which don't.
Hope this helps

----------------------


Hello,

I have a sheet that I need to find all matching pairs that net down to zero based on 2 quantity criteria. I attached a sample sheet below (Column A = Account Key, Column B = Rec Del, Column C = Calculated USD, and Column D = contractual USD).

I've made a unique key by concatenating 2 different columns, and want to 1) remove all Account keys that contain only "Del" or only "Rec" in column B, 2) from the remaining set, find all keys that contain both "Del" and "Rec" in column B such that they Net down to Zero based on Column C value, and Net down to Zero based on Column D value. Also, Column C and Column D should equal and net zero if using a negative value for "Del".

The amounts are in gross value, so you can assign a negative value for say all "Del" items in Column B. I'm trying to work the sumIf function but not sure I'm capturing everything. Can anyone help? Would be greatly appreciated. It shouldn't be too difficult for an experienced exceler. I don't think a macro is needed for this (if it is, I would need to give you all the column labels). My Entire sheet has 10 columns, with over 10,000 rows of data. I would appreciate any help you can provide. I have to create this report for tomorrow :/

AccountKeyRec DelCalculated USD Contractual Usd
001055102OPERATIONS CONTROL ACCOUNTSDel54,754.81 -
001092915OPERATIONS CONTROL ACCOUNTSDel-
001317205NORTHERN TRUSTDel23,577.52 23,577.00
00143M380DEFAULT FOR CPI IIG/IFG ACCTSDel80.72 80.00
00176LDN8CORPORATE CLEARANCE UNMATCHEDRec- -
00176LDN8NATIONAL FINANCIAL SVCS CORPDel13,365.00 13,365.00
001940915OPERATIONS CONTROL ACCOUNTSDel-
0020A2UX8UNALLOCATEDDel1,247,171.88 1,247,171.00
002920AC0WELLS CAPITAL MGMTDel-
003725926OPERATIONS CONTROL ACCOUNTSDel-
003725926CLEARBRIDGE ADVISORS, LLCRec201,917.00
00386SAK8INTERCOMPANY ACCOUNTSDel201,916.67
004239109OPERATIONS CONTROL ACCOUNTSDel37,905.04 37,905.04
004341AV5DEFAULT FOR CPI IIG/IFG ACCTSDel6.75 6.00
004341AY9DEFAULT FOR CPI IIG/IFG ACCTSDel0.01 -
004994919OFFICE TO OFFICE HEDGE REPOSDel9,888.02 -
004994919OFFICE TO OFFICE HEDGE REPOSRec9,888.02 -
00507K103LEGAL & GENERAL INV MGMT LTDRec62,001.57 62,001.00
00512R200DEFAULT FOR CPI IIG/IFG ACCTSDel1.00 1.00
00547Q201DEFAULT FOR CPI IIG/IFG ACCTSDel13.12 13.00
00547Q201DEFAULT FOR CPI IIG/IFG ACCTSRec3.71 3.00
00547Q201NOT AVAILABLEDel3.71 -
005614DS8DEFAULT FOR CPI IIG/IFG ACCTSDel30,000.00 30,000.00
00652G105DEFAULT FOR CPI IIG/IFG ACCTSDel138.20 137.00
00652G105DEFAULT FOR CPI IIG/IFG ACCTSDel0.72 -
00652G105DEFAULT FOR CPI IIG/IFG ACCTSRec45.00 45.00
00652G105DEFAULT FOR CPI IIG/IFG ACCTSRec2.22 1.00
00652G105DEFAULT FOR CPI IIG/IFG ACCTSRec91.68 91.00
00652G105NOT AVAILABLEDel150.00 -
00652G105NOT AVAILABLERec208.20 -
00687U103NOT AVAILABLEDel1,066.00 -
006ESC9F6DEFAULT FOR CPI IIG/IFG ACCTSDel97.50 97.00
00709P108BTG PACTUAL US CAPITAL LLCDel379,975.00 379,975.00
00752K105DEFAULT FOR CPI IIG/IFG ACCTSDel152,722.92 152,722.00
00752K105DEFAULT FOR CPI IIG/IFG ACCTSRec97,166.29 208,069.00
00752K105DEFAULT FOR CPI IIG/IFG ACCTSRec44,544.64 44,544.00
00754V109DEFAULT FOR CPI IIG/IFG ACCTSRec2,000.00 2,000.00

<tbody>
</tbody>
 
Upvote 0
Same question as in post #2.

From your sample data, which ROWS can be netted off ?
Please point out the specific examples which you think should be netted off against each other.
 
Upvote 0
Look at the amount 9,888.02. That would be a net off. If you took a negative value for the "Del" the amounts can net to zero. That's a specific example



Same question as in post #2.

From your sample data, which ROWS can be netted off ?
Please point out the specific examples which you think should be netted off against each other.
 
Upvote 0

Forum statistics

Threads
1,216,116
Messages
6,128,932
Members
449,480
Latest member
yesitisasport

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