+ Reply to Thread
Results 1 to 2 of 2

how to add consecutive positive numbers

  1. #1
    Registered User
    Join Date
    10-02-2005
    Posts
    1

    how to add consecutive positive numbers

    Hi,

    I have an urgent question:

    say i have the following data:

    a1 = -1, a2 = 0, a3 = -2, a4 = 1, a5 = 2, a6 = -1, a7 = -2, a8 = 5, a9 = -1, a10 = 1

    I want to add the first consecutive positive numbers. How do I write a formula for it?

    What I want Excel to do is to go through this and add a4 and a5, that is it. Those are the first cosecutive numbers that appear in the data set.

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451
    Try this in B2 and copy down:

    =IF(AND(MAX(B$1:B1)=0,MIN(A1:A2)>0,A2=A1+1),A1+A2,"")
    Last edited by Cutter; 10-02-2005 at 02:54 PM.

+ 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