+ Reply to Thread
Results 1 to 6 of 6

Sum to first negative number function

  1. #1
    Registered User
    Join Date
    09-22-2014
    Location
    europe
    MS-Off Ver
    microsoft office 2010
    Posts
    23

    Sum to first negative number function

    Hello guys...

    I have different numbers in a column. The problem is I would like to Sum sequence of numbers from C3 (as it is seen on a picture attached) to the first negative number in a column. In a picture of representantion the results should be 2, however I have to say numbers in column do change and so function should always calculate from up to the bottom.

    So far I tried this function, but with no sucess, can any help me understand it better please?

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


    PIC:

    http://postimg.org/image/b2fhdqooj/

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Sum to first negative number function

    Try this in your sample data:
    Please Login or Register  to view this content.
    EDITED TO INCLUDE THIS COMMENT:
    Based on your sample, I assumed that the only valid values are -1, 0, or 1.

    Is that something you can work with?
    Last edited by Ron Coderre; 12-13-2014 at 01:26 PM.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Sum to first negative number function

    Confirmed with Ctrl+Shift+Enter:

    =SUM(C2:INDEX(C2:C15, MATCH(TRUE, C2:C15<0, 0) - 1))
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    09-22-2014
    Location
    europe
    MS-Off Ver
    microsoft office 2010
    Posts
    23

    Re: Sum to first negative number function

    Amazing Ron Coderre! Thank you very much!

  5. #5
    Registered User
    Join Date
    09-22-2014
    Location
    europe
    MS-Off Ver
    microsoft office 2010
    Posts
    23

    Re: Sum to first negative number function

    SHG, your formula works as well. Thank you as well!

  6. #6
    Registered User
    Join Date
    09-22-2014
    Location
    europe
    MS-Off Ver
    microsoft office 2010
    Posts
    23

    Re: Sum to first negative number function

    Yes, I have only threee signals: -1, 0 and 1. Thanks.

+ 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. Replies: 4
    Last Post: 03-20-2012, 06:03 PM
  2. Large Function Won't Show a Negative Number?
    By Tommy1005 in forum Excel General
    Replies: 2
    Last Post: 02-24-2011, 07:26 PM
  3. [SOLVED] Force function to show positive or negative number?
    By smoore in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-03-2006, 04:40 PM
  4. [SOLVED] Creating a function that makes a negative number a zero
    By Tina in forum Excel General
    Replies: 2
    Last Post: 04-01-2005, 01:06 PM
  5. 2003= negative number&2004= negative number How Do I Calculate gro
    By Jason in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-14-2005, 02: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