# Need to eliminate matching amount either in debit credit or in netting

#### aparvez007

##### Member
Hi All,

Need the formula to find the matching amount in debit credit or netting based on Item Number.

Regards,
PaVi

#### Attachments

• 22 KB Views: 4

#### bosco_yip

##### Excel Ninja
Try, with helper column formula solution.

In E3, formula copied down:

=IF((COUNTIF(H:H,G3)>0)*(C3=""),(COUNTIF(G\$2:G3,G3)>COUNTIF(H:H,G3))*B3-C3,0)+IF(COUNTIF(G:G,H3)*COUNTIF(H:H,G3),0,B3-C3)

#### Attachments

• 26 KB Views: 5

#### aparvez007

##### Member
Try, with helper column formula solution.

In E3, formula copied down:

=IF((COUNTIF(H:H,G3)>0)*(C3=""),(COUNTIF(G\$2:G3,G3)>COUNTIF(H:H,G3))*B3-C3,0)+IF(COUNTIF(G:G,H3)*COUNTIF(H:H,G3),0,B3-C3)

View attachment 83421
Thanks, Bosco it's working fine, but my question is if the same amount is there in a different item then it will not give the correct output. Can we match the item number also in the formula?

#### bosco_yip

##### Excel Ninja
Thanks, Bosco it's working fine, but my question is if the same amount is there in a different item then it will not give the correct output. Can we match the item number also in the formula?

Regards

#### aparvez007

##### Member
Netting is a method of reducing risks in financial contracts by combining or aggregating multiple financial obligations to arrive at a net obligation amount.
Thanks