Consulting

Results 1 to 5 of 5

Thread: Solved: Vlookup if not match, find the first bigest value

  1. #1
    VBAX Mentor
    Joined
    Dec 2009
    Posts
    416
    Location

    Solved: Vlookup if not match, find the first bigest value

    Hello

    I have this array
    col1
    125
    145
    136
    189
    569
    578
    145
    256
    etc

    and I have the second array

    col1......... col2
    132..........the first bigest value from array1 IF do not match
    156
    185
    254
    269
    369
    287
    569
    etc

    it is possible to tell to vlookup to find the value from array1 and if did not mach the value to take the FIRST bigest value from the array1.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Don't understand. Give some examples.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor
    Joined
    Dec 2009
    Posts
    416
    Location
    morning,

    please look in attachment
    Attached Files Attached Files

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Try this array formula

    =IF(ISNA(MATCH(A15,$A$2:$A$9,0)),MIN(IF(A2:A9>A15,A2:A9)),MATCH(A15,$A$2:$A $9,0))
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Mentor
    Joined
    Dec 2009
    Posts
    416
    Location
    thank you, it is working fantastic..
    an small correction
    [VBA]
    =IF(ISNA(MATCH(A20,col1,0)),MIN(IF(col1>A20,col1)),VLOOKUP(A20,col1,1))
    [/VBA]

    otherwise match will return position (but this is an detail)..

    have an nice weekend

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •