+ Reply to Thread
Results 1 to 7 of 7

avg # attempts before failure

  1. #1
    Registered User
    Join Date
    03-25-2009
    Location
    St. Louis, MO
    MS-Off Ver
    Excel 2003
    Posts
    3

    avg # attempts before failure

    Trying to calculate average successful attempts before failure. Have several hundred data points (1=success, 0=failure). A1:A10 = 1 1 1 1 1 0 1 1 1 0
    Cell A11 should calculate average attempts between failures for the whole range A1:A10.

    Thanks in advance.
    Last edited by illinigator; 03-25-2009 at 07:42 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,800

    Re: avg # attempts before failure

    So what's the expected result for that example?

    What about

    0 0 1 1 1 0 0 1 1 1

    or

    1 1 1 1 1 0 1 1 1 1

  3. #3
    Registered User
    Join Date
    03-25-2009
    Location
    St. Louis, MO
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: avg # attempts before failure

    For my original post I would expect: (5+3)/2 = 4

    For your data points:
    (1) (0+0+3+0)/4 = .75
    (2) (5)/1 = 5

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

    Re: avg # attempts before failure

    This is inelegant ...
    Please Login or Register  to view this content.
    The array formula in C3 and copied down is =CHOOSE(MATCH(B2 & B3, {"00","01","10","11"}, 0), 0, "", ROWS(B$2:B2) - MATCH(2, 1 / (B$2:B2=0), 1), "" ) (must be confirmed with Ctrl+Shift+Enter)
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,800

    Re: avg # attempts before failure

    Perhaps try

    =COUNTIF(A1:INDEX(A1:A10,MATCH(2,INDEX(1/(A1:A10=0),0))),1)/COUNTIF(A1:A10,0)

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

    Re: avg # attempts before failure

    Very nice, DLL

  7. #7
    Registered User
    Join Date
    03-25-2009
    Location
    St. Louis, MO
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: avg # attempts before failure

    daddylonglegs - could you please explain this to me in layman's terms ??

+ 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