Absolute value sum???

smashclash

Board Regular
Joined
Nov 24, 2003
Messages
126
Office Version
  1. 365
Platform
  1. Windows
I create a monthly report that usually has 6 columns of data. They are as follows: Month Actual, Month Budget, Month Variance, Year Actual, Year Budget, Year Variance. My goal is to eliminate any row who has a 0 balances across. Currently I reference the cells to the right in other columns and take their absolute values. Then I sum those lines. Any sum with a value of 0 can consequently be deleted.

The reason I have to use absolute values to sum a row instead of just taking the sum is as follows. Say a particular row has no month activity, so all 3 columns related to the month are 0. But the year actual has a balance of $100 and the year budget has a balance of 0. Well the year variance would be -$100 and a sum of the line would net a 0 balance. Therefore if I take the absolute values I ensure myself that I will not delete any rows that contain activity.

If anyone knows a function or how to right this into a macro I would be much appreciative. I think I currently have the problem solved by using Access with setting up each "Or:" criteria as <>0. However I would like to know a way to do this in excel. Thanks.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Assuming that your values are in columes A thru F, you could use this formula...
Code:
=SUM(ABS(A1:F1))

:eek: NOTE: This muse be entered as an array formula by using CTRL+SHIFT+ENTER.
 
Upvote 0
TommyGun said:
Assuming that your values are in columes A thru F, you could use this formula...
Code:
=SUM(ABS(A1:F1))

:eek: NOTE: This muse be entered as an array formula by using CTRL+SHIFT+ENTER.


At what point do I do the ctrl+shift+enter command? Sorry I'm a bit of a noob.
 
Upvote 0
smashclash said:
TommyGun said:
Assuming that your values are in columes A thru F, you could use this formula...
Code:
=SUM(ABS(A1:F1))

:eek: NOTE: This muse be entered as an array formula by using CTRL+SHIFT+ENTER.


At what point do I do the ctrl+shift+enter command? Sorry I'm a bit of a noob.

Type the formula then confirm it with control+shift+enter instead of just with enter. Also, the following with just enter:

=SUMPRODUCT(ABS(A1:F1))
 
Upvote 0

Forum statistics

Threads
1,214,424
Messages
6,119,401
Members
448,893
Latest member
AtariBaby

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