Find items that total to zero within a subset

theraindew

New Member
Joined
Dec 7, 2018
Messages
11
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a large data set that i have to work on every day and find out items that match to a zero.
Below is a sample data. Column A has the reference numbers. I have removed the suffixes and kept only the numbers in column B. Column C has amounts. Now, some of the amounts in column C will total to zero for the same reference numbers in column B. I want to identify these matching items and mark them in column D. I have given Yes and No as sample, but this could be anything. Is there a formula or even VBA that can achieve this? I tried sum/if/sumproduct but couldn't get it to work!
Appreciate any help on this.

ReferenceRefAmountMatch
44004345450A44004345450-54,999Yes
44004345450B44004345450-99,999No
44004345450-A44004345450-79,999No
44004345450C44004345450-20,799No
44004345450-B44004345450-216,750No
44004345450D4400434545030,500Yes
44004345450E4400434545024,499Yes
44004541765A44004541765-11,041Yes
44004541765-A44004541765-35,998No
44004541765-B44004541765-36,449No
44004541765B4400454176511,041Yes
44004740328A44004740328-38,998Yes
44004740328-A44004740328-19,499No
44004740328B4400474032838,998Yes
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
T202404.xlsm
ABCD
1
2ReferenceRefAmountMatch
344004345450A44004345450-54999-54999
444004345450B44004345450-99999 
544004345450-A4400434545079999 
644004345450C44004345450-20799 
744004345450-B44004345450216750 
844004345450D4400434545030500 
944004345450E4400434545024499 
1044004541765A44004541765-11041-11041
1144004541765-A4400454176535998 
1244004541765-B4400454176536449 
1344004541765B4400454176511041 
1444004740328A44004740328-38998-38998
1544004740328-A44004740328-19499 
1644004740328B4400474032838998 
17
3e
Cell Formulas
RangeFormula
D3:D16D3=IF(B3<>B2,SUMIFS($C$3:$C$16,$A$3:$A$16,A3),"")
 
Upvote 0
T202404.xlsm
ABCDE
1
2ReferenceRefAmountMatch
344004345450A44004345450-5499910
444004345450B44004345450-99999175951
544004345450-A4400434545079999175951
644004345450C44004345450-20799175951
744004345450-B44004345450216750175951
844004345450D440043454503050010
944004345450E440043454502449910
1044004541765A44004541765-1104110
1144004541765-A440045417653599872447
1244004541765-B440045417653644972447
1344004541765B440045417651104110
1444004740328A44004740328-3899810
1544004740328-A44004740328-19499-19499
1644004740328B440047403283899810
17
3e
Cell Formulas
RangeFormula
E3:E16E3=IF(D3<>1,SUMPRODUCT(--($B$3:$B$16=B3),--($D$3:$D$16=0),$C$3:$C$16),SUMPRODUCT(--($B$3:$B$16=B3),--($D$3:$D$16=1),$C$3:$C$16))
 
Upvote 0
T202404.xlsm
ABCDE
1
2ReferenceRefAmountMatch
344004345450A44004345450-5499910
444004345450B44004345450-99999175951
544004345450-A4400434545079999175951
644004345450C44004345450-20799175951
744004345450-B44004345450216750175951
844004345450D440043454503050010
944004345450E440043454502449910
1044004541765A44004541765-1104110
1144004541765-A440045417653599872447
1244004541765-B440045417653644972447
1344004541765B440045417651104110
1444004740328A44004740328-3899810
1544004740328-A44004740328-19499-19499
1644004740328B440047403283899810
17
3e
Cell Formulas
RangeFormula
E3:E16E3=IF(D3<>1,SUMPRODUCT(--($B$3:$B$16=B3),--($D$3:$D$16=0),$C$3:$C$16),SUMPRODUCT(--($B$3:$B$16=B3),--($D$3:$D$16=1),$C$3:$C$16))

Hi Dave,
thank you for the response. How does column D show 1 for the matching items?
 
Upvote 0
Initially try putting the 1 in manually to see if this idea helps.
The matching may involve more than 2 numbers.
 
Upvote 0

Forum statistics

Threads
1,215,507
Messages
6,125,207
Members
449,214
Latest member
mr_ordinaryboy

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