sum & subtract for the same column based on two values

Alaa mg

Active Member
Joined
May 29, 2021
Messages
343
Office Version
  1. 2019
hi
I have many amounts in column B for each DEBIT,CREDIT in column A so I PUT the result and simple formula in column D , but i need calculation on process does based on DEBIT , CREDIT and I put the value in first row "opening" .this case is not always existed . somtimes not existed .may be you just find startting debit or credit . so the calculation should take value in column B for "opening" if there is existed and sum the amount for debit and subtracrt from credit . and if there is no opening then should sum the debit and subtract from credit . so should sum or subtract from the first and to next .
the formual should be like this when calaculate the amounts = opening+debit-credit in column D .
aaaa.xlsx
ABCD
6MOVINGAMOUNTDESCRIPTIONBALANCE
7OPENING1,000.00
8DEBIT1,000,000.001,001,000.00
9DEBIT200,000.001,201,000.00
10CREDIT50,000.001,151,000.00
11DEBIT1,000,000.002,151,000.00
12DEBIT500,000.002,651,000.00
13CREDIT800,000.001,851,000.00
14
mv
Cell Formulas
RangeFormula
D11:D12,D8:D9D8=D7+B8
D10,D13D10=D9-B10
Cells with Data Validation
CellAllowCriteria
A14:A20List=$E$1:$E$2
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
try this in D8 and copy down

=D7+IF(A8="DEBIT",1,-1)*B8
 
Upvote 0
Solution

Forum statistics

Threads
1,215,432
Messages
6,124,856
Members
449,194
Latest member
HellScout

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