+ Reply to Thread
Results 1 to 4 of 4

Vlookup problem with a range retreiving correct number when negative

  1. #1
    Registered User
    Join Date
    05-15-2019
    Location
    Des Moines, Iowa
    MS-Off Ver
    Office 365
    Posts
    43

    Vlookup problem with a range retreiving correct number when negative

    I am guessing someone will figure this out quickly. In the attachment I have column E & F with percentages. I am doing a vlookup in columns I & L. My question is why does the vlookup give me correct information when the number is positive, but doesn't when negative. Do I need to format something different when the number is negative as in column K? In other words, if I was doing a vlookup of 5% or -5% I should get 2% as the result of my vlookup and currently I am not getting that result.

    Thanks,
    Attached Files Attached Files
    Last edited by tonym33; 12-12-2019 at 12:20 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,232

    Re: Vlookup problem with a range retreiving correct number when negative

    If you use VLOOKUP without specifying the 4th parameter, then it is assumed to be TRUE which means that your data has to be sorted in increasing order. Your data is sorted in columne for +ve numbers, and so I2 returns the correct result, but column F (for negative numbers) is not sorted in increasing order, so the formula in L2 gives an incorrect result.

    You can use INDEX/MATCH instead, as you can specify how the data is sorted using the 3rd parameter of the MATCH function. Put this in L2:

    =INDEX(G4:G12,MATCH(K2,F4:F12,-1))

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    05-15-2019
    Location
    Des Moines, Iowa
    MS-Off Ver
    Office 365
    Posts
    43

    Re: Vlookup problem with a range retreiving correct number when negative

    That worked perfectly....I was considering to do this before, but wasn't sure if there was an easier way with vlookup…….thank you

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,232

    Re: Vlookup problem with a range retreiving correct number when negative

    INDEX/MATCH is more flexible than VLOOKUP, as can be seen in this example.

    Glad to help, and thanks for the rep.

    Pete

+ 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. [SOLVED] Problem with Vlookup choosing a range
    By Stryfe in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-28-2017, 04:31 PM
  2. Range of data and IF then problem maybe Vlookup awell
    By Taw67 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-10-2017, 12:26 AM
  3. [SOLVED] VLOOKUP and Fill Handle Problem: Selected Range vs. Named Range
    By Menenius in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-12-2016, 08:50 PM
  4. Named Range Problem within a VLookup
    By Renleff in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-15-2014, 05:47 PM
  5. Problem using an named range in VLOOKUP
    By stubbsj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-09-2013, 01:18 PM
  6. Macro - Vlookup function, problem with range if only one cell contains data
    By Tapyr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2013, 07:20 AM
  7. [SOLVED] problem using Range Names in VLOOKUP
    By Dee in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-28-2006, 03:00 PM

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