+ Reply to Thread
Results 1 to 2 of 2

Problem with formula for finding last greater than/less than or equal to value

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Asia
    MS-Off Ver
    Excel 2007
    Posts
    1

    Problem with formula for finding last greater than/less than or equal to value

    Hi everyone,

    Here's the issue: Dates (most recent at top) in column A, and then a simple "Win" or "Lose" in Column B, and then in Column C a count of consecutive wins or losses, which starts at +1 for each win and goes up sequentially for each consecutive win thereafter, and starts at -1 for losses and goes down 1 for consecutive losses thereafter.

    What I'm trying to do is find a formula which will record the last time there were the current number of consecutive wins/losses or a greater value.

    I.e. If a team has currently won 4 games in a row, it will display +4 in the current date cell, and I want the formula to show the last time the team won 4 games OR MORE. Likewise, if they've lost 3 times in a row it shows -3, and I want to find the last time the team lost 3 games or even more (so -3,-4,-5, etc.).

    Here's what I have so far (in an array formula):

    =INDEX(A16:A264,MATCH(TRUE,C16:C264>=C15,0))

    Where A16 is the location of the previous date, C16 the location of previous date's +/- value, and C15 the current +/1 value.

    Now the problem is, the formula works perfectly for negative values, so it will always find the last date where the team lost the same or a greater number of games. BUT, when it's working with positive values, the formula returns the date of the last loss (i.e. the most recent negative value) instead of the last positive value which is equal to or greater than the current one.

    Any and all help would be hugely appreciated.

    Thanks!

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Problem with formula for finding last greater than/less than or equal to value

    Is this solved?

    If you solve a problem yourself before anyone else has responded, please take a moment to describe your solution, chances are some other member will benefit.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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