+ Reply to Thread
Results 1 to 4 of 4

Calculating the amount of consecutive values of a specific type

  1. #1
    Registered User
    Join Date
    01-26-2008
    Posts
    14

    Calculating the amount of consecutive values of a specific type

    Hello,

    I want to calculate the consecutive days the % return in column C is negative and at a zero percentage, it starts from cell c8 to c22, the answer should equal 15, but, how do you go about calculating how many times a negative percentage and a zero percentage occur consecutively in column C.

    Look at the table below to understand what I mean.

    A B C
    1 Date $ Return % Return
    2 1-Jan-08 USD 101,000.00 1.00%
    3 2-Jan-08 USD 102,010.00 1.00%
    4 3-Jan-08 USD 103,030.10 1.00%
    5 4-Jan-08 USD 104,060.40 1.00%
    6 5-Jan-08 USD 105,101.01 1.00%
    7 6-Jan-08 USD 106,152.02 1.00%
    8 7-Jan-08 USD 105,090.49 -1.00%
    9 8-Jan-08 USD 104,039.59 -1.00%
    10 9-Jan-08 USD 104,039.59 0.00%
    11 10-Jan-08USD 104,039.59 0.00%
    12 11-Jan-08USD 104,039.59 0.00%
    13 12-Jan-08USD 104,039.59 0.00%
    14 13-Jan-08USD 104,039.59 0.00%
    15 14-Jan-08USD 104,039.59 0.00%
    16 15-Jan-08USD 104,039.59 0.00%
    17 16-Jan-08USD 104,039.59 0.00%
    18 17-Jan-08USD 104,039.59 0.00%
    19 18-Jan-08USD 104,039.59 0.00%
    20 19-Jan-08USD 104,039.59 0.00%
    21 20-Jan-08USD 104,039.59 0.00%
    22 21-Jan-08USD 104,039.59 0.00%
    23 22-Jan-08USD 109,241.57 5.00%
    24 23-Jan-08USD 115,796.06 6.00%
    25 24-Jan-08USD 119,269.95 3.00%

    Apologies for the scattered table, but i hope you get the point. Look forward to hearing from you, thank you.

  2. #2
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    In D2, putting
    =IF(C2>0,0,D1+1) and takeing the maximum of Column D.

    is one way.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  3. #3
    Registered User
    Join Date
    01-25-2008
    Location
    The Netherlands
    MS-Off Ver
    2002, 2003, 2007
    Posts
    94
    Hi Vlad,

    An alternative could be by using the COUNTIF function.
    The following link explains its use.

    http://office.microsoft.com/en-us/ex...090291033.aspx

    Hope it helps

    J.

  4. #4
    Registered User
    Join Date
    01-26-2008
    Posts
    14

    Thank you

    Thank you gentleman, appreciate it.

+ 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