+ Reply to Thread
Results 1 to 4 of 4

Count consecutive positive numbers while ignoring non numerical values

  1. #1
    Registered User
    Join Date
    03-31-2010
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    38

    Count consecutive positive numbers while ignoring non numerical values

    Hi everyone.
    Couldn't find an answer to this one so here goes.

    This array works great to count consecutive occurrences of a negative number, but I need it to skip text values of "NA" or blank cells - essentially ignoring everything except negative and positive values.

    {=MAX(FREQUENCY(IF(AE4:AE630<0,ROW(AE4:AE630)),IF(AE4:AE630>=0,ROW(AE4:AE630))))}

    Any suggestions??

    Thanks in advance.
    williampdx

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Count consecutive positive numbers while ignoring non numerical values

    Try perhaps:

    =MAX(FREQUENCY(IF(AE4:AE630<0,ROW(AE4:AE630)),IF((AE4:AE630>=0)*ISNUMBER(AE4:AE630),ROW(AE4:AE630))))
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    03-31-2010
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: Count consecutive positive numbers while ignoring non numerical values

    That works great. The problem im having now is that if I reverse that around to count consecutive positive numbers,

    =MAX(FREQUENCY(IF(AE4:AE630>0,ROW(AE4:AE630)),IF((AE4:AE630>=0)*ISNUMBER(AE4:AE630),ROW(AE4:AE630))) )

    it seems to count incorrectly - most likely counting the NA as a positive number for some reason. Any suggestions on this?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Count consecutive positive numbers while ignoring non numerical values

    How about?

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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