Add difference to one of two chosen cells

Mr_GZ

New Member
Joined
Aug 1, 2007
Messages
16
I have a debit and a credit column. If one cell in debit is lager than a cell in credit than I would like excel to calculate the difference and add the difference in a cell in the correct row.
For example:

Column A Column B
====== ======
Debit Credit
299,9 300
0,1

Column B contain 10 cent more than column A.
Excel shall then add 0,1 in a cell below 299,9.
If Column A would contain a larger sum then excel should add the difference to the cell below column b. The row will be fixed. All excel have to do is to know what column to add the difference in.

Thanks in advance

Mr_GZ
 

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.
If the row is fixed, then maybe you can do it like this?

Excel Workbook
ABC
1DebitCredit
2299.90300.00
30.10 
4
Debit Credit
 
Upvote 0
Sorry I am getting a #Value! Error. I am sure it is due to I simplified what I wanted out of the formula.
Column B contains one cell with a value for the calculation and Column B ten. The cell with the difference will always be on the row blow the last value under column A - . It is fixed this way.

This is how the formula looks like that I get the error off,
Code:
=IF(A8:18<B8:B18;B8:B18-A8:A18;"")
And then there is the formula for the other way around.
 
Upvote 0
I had to do it like this to get it to work :)
Code:
=IF(SUM(A8:18)<SUM(B8:B18);SUM(B8:B18)-SUM(A8:A18);"")
 
Upvote 0

Forum statistics

Threads
1,213,554
Messages
6,114,280
Members
448,562
Latest member
Flashbond

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