+ Reply to Thread
Results 1 to 11 of 11

Sum negative numbers from specific cells

  1. #1
    Registered User
    Join Date
    07-02-2014
    Location
    Manchester, England
    MS-Off Ver
    2010
    Posts
    7

    Sum negative numbers from specific cells

    Hi,

    I've been looking for a solution to a problem which I have. I want to count all the negative numbers from a range of specific columns. However searching google and the forums here doesn't necessarily provide me with a solution.


    I've used Countif(range,"<0"), and also Sumifs, I still have the issue.
    The problem with this formula is that if I select specific columns like C1, E1, G1 it states "you've entered too many arguments for this function".

    The range I have is at least 25 different column cells to look at and just need to count (sum) for all the negative numbers only.

    Can this be done ?

    Using Office 2019 on a Windows 10 Desktop.

    Thank you in advance.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Sum negative numbers from specific cells

    Administrative note

    Welcome to the forum

    in your haste to solve your problem, you probably missed the yellow banner advising how to get answers faster by posting a sheet ?

    Please take a moment to read it and attach a sheet accordingly.

    Thanks you for helping us help you

  3. #3
    Registered User
    Join Date
    07-02-2014
    Location
    Manchester, England
    MS-Off Ver
    2010
    Posts
    7

    Re: Sum negative numbers from specific cells

    Sorry, please see the attached.

    For example I need to count the negative numbers for person 2 for August then October then December. I don't need the other months.

    Much appreciated.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    06-12-2020
    Location
    USA
    MS-Off Ver
    2013
    Posts
    132

    Re: Sum negative numbers from specific cells

    Quote Originally Posted by windoz View Post
    Sorry, please see the attached.

    For example I need to count the negative numbers for person 2 for August then October then December. I don't need the other months.

    Much appreciated.
    I wasn't sure if you wanted a sum of the negative numbers or the number of negative occurrences. Try these in cell N3.

    =SUMPRODUCT((B3:M3)*(B3:M3<0)*(($B$1:$M$1="Aug")+($B$1:$M$1="Oct")+($B$1:$M$1="Dec"))) (Gives sum of negative amounts)
    =SUMPRODUCT(--(((B3:M3)*(($B$1:$M$1="Aug")+($B$1:$M$1="Oct")+($B$1:$M$1="Dec")))<0)) (Gives the number of negative occurrences)

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Sum negative numbers from specific cells

    @bird
    Administrative Note:

    Please don't quote entire posts unnecessarily. They clutter threads and make them hard to read.
    Use the "Quick reply" instead
    Thanks

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Sum negative numbers from specific cells

    Try
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and pull down

  7. #7
    Registered User
    Join Date
    07-02-2014
    Location
    Manchester, England
    MS-Off Ver
    2010
    Posts
    7

    Re: Sum negative numbers from specific cells

    Pepe Le Mokko, Thank you for your time to respond and I really appreciate the solution you have provided.

  8. #8
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Sum negative numbers from specific cells

    You're welcome

  9. #9
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Sum negative numbers from specific cells

    Quote Originally Posted by bird333 View Post
    . . .

    =SUMPRODUCT((B3:M3)*(B3:M3<0)*(($B$1:$M$1="Aug")+($B$1:$M$1="Oct")+($B$1:$M$1="Dec"))) [sum]

    =SUMPRODUCT(--(((B3:M3)*(($B$1:$M$1="Aug")+($B$1:$M$1="Oct")+($B$1:$M$1="Dec")))<0)) [count]
    For what it's worth, you could condense these to

    =SUMPRODUCT((B3:M3<0)*($B$1:$M$1={"Aug";"Oct";"Dec"}),B3:M3) [sum]

    =SUMPRODUCT((B3:M3<0)*($B$1:$M$1={"Aug";"Oct";"Dec"})) [count]

  10. #10
    Forum Contributor
    Join Date
    06-12-2020
    Location
    USA
    MS-Off Ver
    2013
    Posts
    132

    Re: Sum negative numbers from specific cells

    Quote Originally Posted by hrlngrv View Post
    For what it's worth, you could condense these to

    =SUMPRODUCT((B3:M3<0)*($B$1:$M$1={"Aug";"Oct";"Dec"}),B3:M3) [sum]

    =SUMPRODUCT((B3:M3<0)*($B$1:$M$1={"Aug";"Oct";"Dec"})) [count]
    Thanks! It's always good to learn more about sumproduct.

  11. #11
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Sum negative numbers from specific cells

    The thing to note is B1:M1 is a 1-row by 12-column range, {"Aug";...} a 3-row by 1-column array, and B1:M1={"Aug";...} is then a 3-row by 12-column derived array.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] sum two cells but ignore negative numbers
    By chriswrcg in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-05-2019, 06:53 AM
  2. [SOLVED] How to change numbers to negative numbers specific with a text
    By Patnaik in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-11-2012, 07:22 AM
  3. Sum only negative numbers for a specific name.
    By CoryX in forum Excel General
    Replies: 5
    Last Post: 05-18-2009, 04:16 PM
  4. change 2000 cells (negative numbers) into positive numbers
    By lisbern in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-16-2006, 01:00 PM
  5. Can numbers be typed to automatically be negative in cells?
    By finnplan in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-08-2005, 06:30 PM
  6. Negative Numbers in Cells
    By rob in forum Excel General
    Replies: 2
    Last Post: 11-11-2005, 11:10 AM
  7. [SOLVED] Converting negative numbers in a range of cells to zero
    By Dede in forum Excel General
    Replies: 3
    Last Post: 01-14-2005, 03:06 PM

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