+ Reply to Thread
Results 1 to 7 of 7

vlookup Question about descending numbers

  1. #1
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270

    vlookup Question about descending numbers

    i'm using a workbook to hold my data, and its entered in the order of which it receives data, so basically each new entry is added to the top of the worksheet and the first column has the ID transaction which is higher then the ones previous to it. When I use Vlookup to search the entries. I can't seem to use vlookup to search for my oldest entries. Basically ID numbers under 100 aren't being picked up anymore unless i resort my whole data sheet in ascending order. Is there anyway i can have vlookup work without having to change the order of the IDs from the way they are being entered? or is there a different command i can use?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Slx,

    The formula can lookup in ascending, or unsorted orders, but not descending. This explanation should help...

    Syntax

    VLOOKUP(lookup_value, table_array, col_index_num, range_lookup)


    Lookup_value is the value to be found in the first column of the array. Lookup_value can be a value, a reference, or a text string.

    Table_array is the table of information in which data is looked up. Use a reference to a range or a range name, such as Database or List.

    If range_lookup is TRUE, the values in the first column of table_array must be placed in ascending order: ..., -2, -1, 0, 1, 2, ..., A-Z, FALSE, TRUE; otherwise VLOOKUP may not give the correct value. If range_lookup is FALSE, table_array does not need to be sorted.
    1. You can put the values in ascending order by choosing the Sort command from the Data menu and selecting Ascending.
    2. The values in the first column of table_array can be text, numbers, or logical values.
    3. Uppercase and lowercase text are equivalent.
    Sincerely,
    Leith Ross
    Last edited by Leith Ross; 11-12-2007 at 03:32 PM.

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    vlookup Question about descending numbers

    This would have been a good thread to post your formula into (hint, hint)

    Absent that...
    Try something like this:

    =VLOOKUP(A1,B1:D10,2,FALSE)

    I suspect your issue lies with the 4th argument of your VLOOKUP functions. It's either missing or set to TRUE (or 1). For exact matches, it needs to be set to FALSE or 0.

    See the Excel Help on VLOOKUP for more information.

    Does that help?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582
    If you are looking for specific values, you need your VLOOKUP to end with False. It would look like this;
    Please Login or Register  to view this content.
    ChemistB

  5. #5
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270
    This is what i am using for my formula

    =IF(ISNA(VLOOKUP($A$6,'[Client ID Masterlist.xls]CLIENT MASTERLIST'!$1:$65536,FALSE))=TRUE,"",IF(VLOOKUP($A$6,'[Client ID Masterlist.xls]CLIENT MASTERLIST'!1:65536,7,FALSE)="N/A","N/A",IF(VLOOKUP($A$6,'[Client ID Masterlist.xls]CLIENT MASTERLIST'!1:65536,2,FALSE)=0,"",VLOOKUP($A$6,'[Client ID Masterlist.xls]CLIENT MASTERLIST'!1:65536,2,FALSE)&", "&VLOOKUP($A$6,'[Client ID Masterlist.xls]CLIENT MASTERLIST'!1:65536,3,FALSE))))

    Its a bit messy, but the core formula is
    VLOOKUP($A$6,'[Client ID Masterlist.xls]CLIENT MASTERLIST'!1:65536,2,FALSE)

    In terms of descending order, it works up until i get to under 100. IDs 1-99 cant seem to be found.

    Thanks for taking your time in lookin into this

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    vlookup Question about descending numbers

    Quote Originally Posted by slx
    In terms of descending order, it works up until i get to under 100. IDs 1-99 cant seem to be found.
    Hmmmm....here's a thought:

    Check numbers 1-99. Are they really numbers? or are they text?
    If those cells are formatted as "text" or contain text (eg '099) and the VLOOKUP is searching for numbers, those text values won't be recognized.

    Does that help?

  7. #7
    Forum Contributor
    Join Date
    04-24-2007
    Location
    NYC
    MS-Off Ver
    2k3/2k7/2010
    Posts
    270
    all the numbers in the first colum, my ID column are numbers. Its just that when i put them in descending order, vlookup can't seem to figure out where the IDs 1-99 are, but when its in ascending order, Vlookup has no problems at all.

    perhaps i should use the index function instead?

    Just that vlookup has been workin pretty well for me up until now.

+ 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