+ Reply to Thread
Results 1 to 6 of 6

Trying to add a column of numbers, but ignoring negatives

  1. #1
    Registered User
    Join Date
    01-21-2009
    Location
    Essex, England
    MS-Off Ver
    Office 2000 in work, Office 2003 at home
    Posts
    10

    Wink Trying to add a column of numbers, but ignoring negatives

    Hi,

    I'm trying to SUM a column, but it has a negative number in it. I want to sum the column but ignore the negative number.

    I.E.
    5
    46
    12
    -15
    3

    so the total would be 66.

    How is this possible or would i have to use another formula instead of SUM.

    Cheers,

    John
    Last edited by Lord Waste; 04-07-2009 at 06:43 AM.

  2. #2
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Cardiff
    MS-Off Ver
    2003
    Posts
    123

    Re: Trying to add a column of numbers, but ignoring negatives

    If you add a helper column you can take out the negatives from that;
    =IF($A1>0, A1,0)

    then sum that column

  3. #3
    Registered User
    Join Date
    01-21-2009
    Location
    Essex, England
    MS-Off Ver
    Office 2000 in work, Office 2003 at home
    Posts
    10

    Re: Trying to add a column of numbers, but ignoring negatives

    There is also other numbers being added weekly, so the total needs to update it's self as the numbers get added.

    Ideally would like to do this as one column with out having to deal with anymore, as I already have 30 columns of information to deal with.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Trying to add a column of numbers, but ignoring negatives

    =sumif(a1:a10,">0")
    or whole column

    =sumif(A:A,">0")
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    01-21-2009
    Location
    Essex, England
    MS-Off Ver
    Office 2000 in work, Office 2003 at home
    Posts
    10

    Re: Trying to add a column of numbers, but ignoring negatives

    Quote Originally Posted by martindwilson View Post
    =sumif(a1:a10,">0")
    or whole column

    =sumif(A:A,">0")
    Thank you martin.

  6. #6
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Cardiff
    MS-Off Ver
    2003
    Posts
    123

    Re: Trying to add a column of numbers, but ignoring negatives

    For the sum formula you can get a dynamic range.

    try this link: http://www.ozgrid.com/Excel/DynamicRanges.htm

    you can use this so that it will sum all of the values, up to the last cell that has a number in it.

    I think there is a similar thing you can do with the formula, but not sure howto do it myself. It will have offset in there somewhere i guess, maybe try startinga new thread for this question... something along the lines of "creating a dynamic formula" hope this helps

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1