+ Reply to Thread
Results 1 to 10 of 10

Vlookup not selecting the correct cell

  1. #1
    Registered User
    Join Date
    02-21-2017
    Location
    Castelford
    MS-Off Ver
    2013
    Posts
    89

    Vlookup not selecting the correct cell

    Hi All,

    I have been doing some testing on a worksheet and have noticed my VLOOKUP is not selecting the correct cell as it should, it should be selecting the next cell down because the value is higher than the data match.

    I have attached my workbook for your assistance with highlighted cells.

    Cell I6 = 190A so it should select Cell I15 but at the minute it is selecting I14 which is not the correct cell because Cell I6 is larger than cell I14.

    Any help with this would be greatly appreciated.
    Attached Files Attached Files

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Vlookup not selecting the correct cell

    Which cell contains your formula?

  3. #3
    Registered User
    Join Date
    02-21-2017
    Location
    Castelford
    MS-Off Ver
    2013
    Posts
    89

    Re: Vlookup not selecting the correct cell

    Its AC6 on sheet FORM1-TEMP

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Vlookup not selecting the correct cell

    I can't find your VLOOKUP but I (suspect) it is working correctly as it will return the value that is LESS THAN the search value if there is not an exact match.

    EDIT: INDEX/MATCH not VLOOKUP but above applies.
    Last edited by JohnTopley; 03-29-2017 at 10:42 AM.

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Vlookup not selecting the correct cell

    The MATCH function using the 'closest match' lookup type, finds the largest value that is LESS than the lookup value.
    So it is returning the correct value

    If you want it to return the next highest value, you have a few choices.
    1) Add 1 to the result of the match
    =IF(I6*1.25>DATA!I60,"DISTBLOCK",INDEX(DATA!I5:I20,MATCH('FORM-1 TEMP'!I6,DATA!J5:J20)+1))

    2) Offset the index range by 1 row
    =IF(I6*1.25>DATA!I60,"DISTBLOCK",INDEX(DATA!I6:I21,MATCH('FORM-1 TEMP'!I6,DATA!J5:J20)))

    3) Sort the lookup table (I5:J20 in Descending order by column J), and use -1 as the match type
    =IF(I6*1.25>DATA!I60,"DISTBLOCK",INDEX(DATA!I5:I20,MATCH('FORM-1 TEMP'!I6,DATA!J5:J20,-1)))

  6. #6
    Registered User
    Join Date
    02-21-2017
    Location
    Castelford
    MS-Off Ver
    2013
    Posts
    89

    Re: Vlookup not selecting the correct cell

    All I have got this wrong! it is not a VLOOKUP at all, it is INDEX MATCH!!

    Sorry for the confusion!!

  7. #7
    Registered User
    Join Date
    02-21-2017
    Location
    Castelford
    MS-Off Ver
    2013
    Posts
    89

    Re: Vlookup not selecting the correct cell

    Jonmo1, I have gone with the first option as this worked first time!

    Thank you for your help!!

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Vlookup not selecting the correct cell

    You're welcome.

    Keep in mind you will have #N/A errors if:
    A) The lookup value is Greater than the last value in the column, J20
    B) The lookup value is Less than the first value in the column, J5

  9. #9
    Registered User
    Join Date
    02-21-2017
    Location
    Castelford
    MS-Off Ver
    2013
    Posts
    89

    Re: Vlookup not selecting the correct cell

    I have changed my range so if it is bigger or smaller it will return 0 or COPPER.

    Thanks again.

  10. #10
    Registered User
    Join Date
    02-21-2017
    Location
    Castelford
    MS-Off Ver
    2013
    Posts
    89

    Re: Vlookup not selecting the correct cell

    I think i may have clicked solve a bit too quick, i'm not sure how I would change the formula so if it was less that J5 to show the botttom value cell.

    so if Cell I6<= CEll J6 it should select Cell I5

    =IF(I6>DATA!J57,"DISTBLOCK",INDEX(DATA!I5:I20,MATCH('FORM-1 TEMP'!I6,DATA!J4:J20)+1))

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Selecting the Correct Formula
    By vincywoman1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-11-2014, 01:40 AM
  2. [SOLVED] script to selecting correct sheet calculated via cell formula
    By Kramxel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2013, 09:42 AM
  3. VLOOKUP not returning the correct value in cell
    By RyanEAS in forum Excel General
    Replies: 5
    Last Post: 03-07-2012, 02:05 PM
  4. Selecting correct cell after Autofilter
    By subtilty in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2011, 11:49 AM
  5. Vlookup Function Arguments are correct but nothing in cell
    By Tom in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-24-2006, 07:41 PM
  6. [SOLVED] vlookup is returning a value one cell above the correct cell.
    By dbaker4 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-20-2006, 03:25 PM
  7. [SOLVED] vlookup: I have to double click each cell to get correct results?
    By gillyd in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-24-2006, 09:10 AM

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