+ Reply to Thread
Results 1 to 3 of 3

Identify and count consecutive negative figures in a dataset

Hybrid View

cmpayne Identify and count... 02-06-2024, 05:51 AM
AliGW Re: Identify and count... 02-06-2024, 05:55 AM
Glenn Kennedy Re: Identify and count... 02-06-2024, 05:58 AM
  1. #1
    Registered User
    Join Date
    02-06-2024
    Location
    Zimbabwe
    MS-Off Ver
    Microsoft 365
    Posts
    1

    Identify and count consecutive negative figures in a dataset

    Hi there,
    I am currently trying to identify and count multiple series of negative figures separately in a dataset. I have copied an example below, I need an annual tally of the length of each set of negative figures.

    10/04/2002 -25.89999
    11/04/2002 -23.78478
    12/04/2002 -9.33111
    13/04/2002 -0.58254 4
    14/04/2002 3.33667
    15/04/2002 8.56847
    16/04/2002 12.43831
    17/04/2002 11.18699
    18/04/2002 9.47207
    19/04/2002 7.91838
    20/04/2002 7.30859
    21/04/2002 5.71721
    22/04/2002 4.1068
    23/04/2002 2.70522
    24/04/2002 1.4354
    25/04/2002 0.29924
    26/04/2002 -1.01067
    27/04/2002 -2.00181
    28/04/2002 -3.15657
    29/04/2002 -4.19175
    30/04/2002 -5.51461
    01/05/2002 -6.15286
    02/05/2002 -6.99173
    03/05/2002 -7.81675
    04/05/2002 -8.58129
    05/05/2002 -9.12188 10

    Is there a formula that can count consecutive negative values in segments, skipping over the positive values? As to avoid manually counting the periods (eg. 4 and 10)
    Last edited by cmpayne; 02-06-2024 at 05:51 AM. Reason: Error in layout

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,458

    Re: Identify and count consecutive negative figures in a dataset

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook (yellow banner: HOW TO ATTACH YOUR SAMPLE WORKBOOK). Screenshots are of little practical use as we cannot manipulate them.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Identify and count consecutive negative figures in a dataset

    One way, copied down:

    =IF(AND(OR(B3="",B3>0),B2<0),COUNTIF(B$2:B2,"<0")-SUM(C$1:C1),"")
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

+ 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: 29
    Last Post: 11-13-2022, 11:11 AM
  2. [SOLVED] Count Consecutive Positive/Negative numbers
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2013, 01:02 PM
  3. Need a formula that will count "consecutive" negative amounts in a row.
    By Scorpvin in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-01-2013, 11:21 AM
  4. count the series of consecutive positive/negative values and sum them
    By otage in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-12-2012, 12:43 PM
  5. Count consecutive number of negative occurrences >=3
    By nbiggss in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-02-2012, 02:14 PM
  6. count consecutive negative days
    By pault22 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-21-2010, 08:10 AM
  7. count the # of consecutive negative #'s in a range
    By newToExcel in forum Excel General
    Replies: 5
    Last Post: 11-12-2005, 09:15 PM

Tags for this Thread

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