Results 1 to 1 of 1

Excel 2007 : Return first value below and above search value problem

Threaded View

  1. #1
    Registered User
    Join Date
    12-24-2010
    Location
    Ohio
    MS-Off Ver
    Excel 2007
    Posts
    89

    Return first value below and above search value problem

    Nevermind,

    Used MAX and MIN

    George


    Morning

    In the attached file the idea is to search for a value (entered in F5) within a range of values and then to return from the range of values the first value lower and higher than the searched for value.

    The problem is that this works correctly for some searched values, and incorrectly for others.

    So in A2:A14 the values are 0-360 (incremented by 30)

    In C2 (should return first lower value) the formula is:
    {=INDEX(A2:A14,MATCH(SMALL(ABS(A2:A14-$F$5),ROW(A1)),IF(COUNTIF($C$1:C1,A2:A14)<COUNTIF(A2:A14,A2:A14),ABS(A2:A14-$F$5),"A"),0))}
    In C3 (should return first higher value) the formula is:
    {=INDEX(A2:A14,MATCH(SMALL(ABS(A2:A14-$F$5),ROW(A2)),IF(COUNTIF($C$1:C2,A2:A14)<COUNTIF(A2:A14,A2:A14),ABS(A2:A14-$F$5),"A"),0))}
    Any thoughts on how to fix this problem?

    Thanks in advance.

    George
    Attached Files Attached Files
    Last edited by BigGPL; 03-28-2012 at 09:41 AM.

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