Formula to Match Debit & credit values

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,589
Office Version
  1. 2021
Platform
  1. Windows
I have debit values in Col F & credit values in Col G the balance in Col K


I have tried to set up a formula so that where the debit and credit balances are the same, then "delete" to appear in Col L otherwise "remain" to appear


The formula works for some of the items. The items in Yellow should appear as delete.


It would be appreciated if someone could kindly amend my formula to accommodate my requirements



Excel 2012
FGHIJKL
22001200Delete
32001200Delete
47001700Remain
5165PO 23503 Cut key as per example1165Remain
6607.91PO 23506 Supply and fit battery1607.91Delete
7450PO 23505 Assemble lock to suit key1450Remain
84501450Remain
9607.911607.91Delete
104501450Remain
114501450Remain
124501450Remain
Sheet1
 
Last edited:

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Not sure I understand. Copying the formula down from L2 shows "Delete" for those cells. What's the problem?

WBD
 
Upvote 0
may be a silly question

how are you viewing the formula ???

i copied the table into excel and only get values

regards

Haha!! The OP removed the formulas when the post was edited! It was originally this:


Book1
FGHIJKL
1DebitCreditStock NoNarrativePeriodMonthBalanceDelete Row
22001200Delete
32001200Delete
47001700Remain
51651165Remain
6607.911607.91Delete
74501450Delete
84501450Delete
9607.911607.91Delete
101569.1211569.12Remain
111501150Delete
121501150Delete
Sheet1
Cell Formulas
RangeFormula
K2=+F2+G2
L2=IF(COUNTIF(F:F,K2)=COUNTIF(G:G,K2),"Delete","Remain")


WBD
 
Upvote 0
See sample data with formulas


Excel 2012
FGHIJKL
1DebitCreditStock NoNarrativePeriodMonthBalanceDelete Row
22001200Delete
32001200Delete
47001700Remain
5165PO 23503 Cut key as per example1165Remain
6607.91PO 23506 Supply and fit battery1607.91Delete
7450PO 23505 Assemble lock to suit key1450Remain
84501450Remain
9607.911607.91Delete
104501450Remain
114501450Remain
124501450Remain
13
14
15
16
17
18
19
20
Sheet1
Cell Formulas
RangeFormula
K2=+F2+G2
L2=IF(COUNTIF(F:F,K2)=COUNTIF(G:G,K2),"Delete","Remain")
 
Upvote 0
Your formula & spreadsheet have no way of link each debit with each credit. What happens if two different purchasers spend the same amount, one could pay and both could be marked as paid?
 
Upvote 0
Thanks Tony. Fully understand the situation. one would need a common account or reference to match these off
 
Upvote 0
The way to match the items is the if the amount in Col F = Col G and the date for the debit amount is either the same as the amount of the credit amount or max two days after then "delete" to appear in Col L or Remain


See sample data below

It would be appreciated if someone could amend my formula




Excel 2012
EFGHIJKL
1DateDebitCreditStock NoNarrativePeriodMonthBalanceDelete/Remain
201/10/20152001200Delete
301/10/20152001200Delete
401/10/20157001700Remain
501/10/20151651165Delete
601/10/2015607.911607.91Delete
701/10/20154501450Delete
801/10/20154501450Delete
901/10/2015607.911607.91Delete
1005/10/20151569.1211569.12Remain
1105/10/20151501150Remain
1205/10/20151501150Remain
1305/10/20153601360Remain
1405/10/20151501150Remain
1505/10/20151201120Delete
1605/10/20151201120Delete
1705/10/2015171011710Delete
1805/10/2015171011710Delete
1906/10/20151651165Delete
2006/10/20151719.1211719.12Remain
2107/10/2015170011700Remain
2207/10/20151501150Remain
2308/10/20151001100Remain
2408/10/20151651165Delete
2508/10/2015866.321866.32Remain
2608/10/20151651165Delete
2708/10/2015210.481210.48Delete
2809/10/2015210.481210.48Delete
29
Sheet1
Cell Formulas
RangeFormula
K2=+F2+G2
L2=IF(COUNTIF(F:F,K2)=COUNTIF(G:G,K2),"Delete","Remain")
 
Last edited:
Upvote 0
I have come up with a solution of the dates match, but need it amended to add max two days


Code:
=IF(AND(E2=E3),IF(COUNTIF(F:F,K2)=COUNTIF(G:G,K2),"Delete","Remain"),"remain")
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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