Subtract Positive and Negative Values (+/- numbers in same column)

flare9x

Board Regular
Joined
Jan 29, 2016
Messages
120
Hello

This is what i am trying to achieve:

In column: AU I have the net total of various numbers. Sometimes the net number is positive other times negative.

I want to know the difference between Column AT and AS.....

So this is what I have tried:

=AS-AT

Problem with this: if AT is a negative number and AS is positive it adds to make a negative... Not what im looking for, the answer should be: -8.70.

AS AT AU (net)
1.98-10.68-12.66
-1.062.20-3.26
9.53-3.076.46
6.070.185.89
3.901.212.69
3.79-0.353.44
-5.750.22-5.97
1.294.96-3.67
-9.64-7.33-16.97
11.224.746.48
-0.041.86-1.90
7.02-5.711.31
3.474.06-0.59
-1.91-1.78-3.69
4.691.413.28
3.65-2.740.91
-0.11-3.75-3.86
6.09-1.294.80
-8.28-3.91-12.19
5.573.002.57
5.294.470.82
0.887.12-6.24
-0.89-1.60-2.49
0.792.73-1.94

<colgroup><col width="64" span="2" style="width:48pt"><col width="64" style="width:48pt"></colgroup><tbody>
</tbody>

<colgroup><col width="64" span="2" style="width:48pt"><col width="64" style="width:48pt"></colgroup><tbody>
</tbody>


I then try this: =AS2-ABS(AT2)
Problem: This works with AT being negative number and AS being positive... the result is correct at -8.70.
However the problem then goes on IF: AS is negative value and AT positive.... the numbers are added to create -3.26 which is errorsome, the correct value should be 1.14

AS AT AU (Net)
1.98-10.68-8.70
-1.062.20-3.26
9.53-3.076.46
6.070.185.89
3.901.212.69
3.79-0.353.44
-5.750.22-5.97
1.294.96-3.67
-9.64-7.33-16.97
11.224.746.48
-0.041.86-1.90
7.02-5.711.31
3.474.06-0.59
-1.91-1.78-3.69
4.691.413.28
3.65-2.740.91
-0.11-3.75-3.86
6.09-1.294.80
-8.28-3.91-12.19
5.573.002.57
5.294.470.82
0.887.12-6.24
-0.89-1.60-2.49
0.792.73-1.94

<colgroup><col width="64" span="2" style="width:48pt"><col width="64" style="width:48pt"></colgroup><tbody>
</tbody>


I then try this: =AT2-ABS(AS2)
Problem with this: If AT2 is negative, then it adds the positive to make a deeper negative: -12.66. However, this works when the AS column is a negative value.... the formula is correct and gives correct value of 1.14.

1st hour Last HourNet
1.98-10.68-12.66
-1.062.201.14
9.53-3.07-12.60
6.070.18-5.89
3.901.21-2.69
3.79-0.35-4.14
-5.750.22-5.53
1.294.963.67
-9.64-7.33-16.97
11.224.74-6.48
-0.041.861.82
7.02-5.71-12.73
3.474.060.59
-1.91-1.78-3.69
4.691.41-3.28
3.65-2.74-6.39
-0.11-3.75-3.86
6.09-1.29-7.38
-8.28-3.91-12.19
5.573.00-2.57
5.294.47-0.82
0.887.126.24
-0.89-1.60-2.49
0.792.731.94

<colgroup><col width="64" span="2" style="width:48pt"> <col width="64" style="width:48pt"> </colgroup><tbody>
</tbody>



Has anyone got the answer? Im thinking along the lines of
=if AS is >0 value and AT<0 value then =AS2-ABS(AT2) IF NOT then... =AT2-ABS(AS2)

Thanks for any help
 
Maybe:
=IF(AT2>AS2,ABS(AT2)-ABS(AS2),ABS(AS2)-ABS(AT2))


Edit: looks like SpillerBD may be understanding what you are after, and it is not as complex as it is being made out to be!
Or more simply...

=ABS(ABS(AS2)-ABS(AT2))
 
Upvote 0

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
It's kind of hard to tell what you want, because you only corrected the results of the first 2 in your table, but does this do what you want?

=-(-AT2-AU2)
 
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,984
Members
449,201
Latest member
Lunzwe73

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