Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 43
Default Subtotaling minus negative numbers and posative numbers

Hi All,

I have a column with a mix of positive and negative numbers.
What Subtotal formulas can I use to sum only the positive numbers and
a second formula below the first one to show negative numbers.
This column will be auto filtered so I need a "Subtotal" function.

Thanks for your help

Tom
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default Subtotaling minus negative numbers and posative numbers

I don't believe you will be able to do it with just a single subtotal
several ways to do it
=sum(if(and(d:d<0,autofilter criteria),D:D)) entered as array
control-shift-enter
might work
two helper columns with
=max(d1,0)
=min(D1,0)
and subtotal these helper columns should work

"lehigh46" wrote:

Hi All,

I have a column with a mix of positive and negative numbers.
What Subtotal formulas can I use to sum only the positive numbers and
a second formula below the first one to show negative numbers.
This column will be auto filtered so I need a "Subtotal" function.

Thanks for your help

Tom

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Subtotaling minus negative numbers and posative numbers

With a macro

Sub sonic()
Set myrange = Range("A2:A9")
myrange.SpecialCells(xlVisible).Select
For Each c In Selection
If c.Value < 0 Then
negtot = negtot + c.Value
Else
postot = postot + c.Value
End If
Next
MsgBox (negtot)
MsgBox (postot)
End Sub


Note if you go this route you could wrte the results to a cell on your sheet
and you should include some error checks for text values.

Mike
"lehigh46" wrote:

Hi All,

I have a column with a mix of positive and negative numbers.
What Subtotal formulas can I use to sum only the positive numbers and
a second formula below the first one to show negative numbers.
This column will be auto filtered so I need a "Subtotal" function.

Thanks for your help

Tom

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Subtotaling minus negative numbers and posative numbers

I bet you get a better answer than this, but you could always insert an extra
column in your filtered range and use a formula like:

=if(a20,a2,"")

And use =subtotal() against that column.

And add a second column with a similar formula for the negative values.

lehigh46 wrote:

Hi All,

I have a column with a mix of positive and negative numbers.
What Subtotal formulas can I use to sum only the positive numbers and
a second formula below the first one to show negative numbers.
This column will be auto filtered so I need a "Subtotal" function.

Thanks for your help

Tom


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
col of minus numbers changed to plus numbers Cecil1234 Excel Worksheet Functions 4 December 7th 06 01:04 AM
How do you put negative/minus numbers in brackets IoHeFy Excel Discussion (Misc queries) 2 October 25th 06 12:12 PM
How do I change minus numbers to + numbers in a col in Excel? Paul L Charts and Charting in Excel 1 May 16th 06 09:06 PM
ADD NEGATIVE NOT POSATIVE mark d davis Charts and Charting in Excel 6 January 5th 06 11:20 PM
convert negative numbers to positive numbers and vice versa bill gras Excel Worksheet Functions 4 December 7th 05 01:39 AM


All times are GMT +1. The time now is 09:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"