+ Reply to Thread
Results 1 to 9 of 9

Thread: Is there anyway to use Vlookup for negative values or a range of values?

  1. #1
    Registered User
    Join Date
    10-24-2008
    Location
    singapore
    Posts
    22

    Is there anyway to use Vlookup for negative values or a range of values?

    Hi to all.

    I am new to excel and would like to improve my skills. I recently encountered this problem. If i want to put a subject for a negative values, how should i do it?

    For example:

    lookup_value: -1000
    table_array:
    <0 - Poor
    0-10000 - Good
    > 10000 - excellent

    is it possible to do this? ALternatively see the (new) attachment for clearer question...
    Last edited by excelplshelp1; 10-31-2008 at 03:17 AM.

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636
    Use formula:

    in B16, for example:


    =LOOKUP(A16,{-9.99999E+307,0,10000},{"Poor","Good","Excellent"})

    To colour "Poor" red...

    Select cells and go to Format|Conditional Formatting

    Choose Cell Value Is >> Equal to >> enter: ="Poor"

    Click Format and choose Red from "Font" tab.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    10-24-2008
    Location
    singapore
    Posts
    22
    Your explanation seems too ADVANCE for me to know. As i am new to excel, could you express it in more simple terms so that i can understand better? Thanks

    or perhaps show me in an attachment how it is being done so that i can explore deeper? Thanks Thanks a million :D
    Last edited by excelplshelp1; 10-27-2008 at 12:50 PM. Reason: Add more details

  4. #4
    Extremely Helpful member
    Join Date
    12-23-2006
    Location
    Belgium
    MS-Off Ver
    XL2003
    Posts
    6,127
    It is actually the vector form of the LOOKUP function ( see XL help for more info) where the ranges are hard-coded instead of for example A1:A5
    The first term between braces is the lowest number that XL understands in scientific notation. So the formula looks if A1 is in the interval between the numbers in the first range and picks the corresponding value in .So if A1 is between 0 and 10000 it's in the second interval, and Lookup chooses "Good" which is the second value in the second range

    HTH
    Quoting entire posts clutters the forum and makes threads hard to read !

    If you are pleased with a member's answer then use the Star icon to rate it

    Click here to see forum rules

  5. #5
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636
    Quote Originally Posted by excelplshelp1 View Post
    Your explanation seems too ADVANCE for me to know. As i am new to excel, could you express it in more simple terms so that i can understand better? Thanks

    or perhaps show me in an attachment how it is being done so that i can explore deeper? Thanks Thanks a million :D
    See attachment..
    Attached Files Attached Files
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  6. #6
    Registered User
    Join Date
    10-24-2008
    Location
    singapore
    Posts
    22
    Sorry... I do not much understand of the solutions gave. Let me express in simpler terms,

    Is it possible to have a range of values for the table as I do not wish to press -999999999 for numbers below 0? Or are there other ways? Thanks I want only VLOOKUP or any lookup function THX

  7. #7
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636
    If you look in B19 and down in my attached sample, you will see the formula I created.

    All you have to do is enter any value in A19 and down, and the formula will give you the desired result. And if the result is the word "Poor", then it will turn red.

    You don't need to enter those parameters everytime.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  8. #8
    Registered User
    Join Date
    10-24-2008
    Location
    singapore
    Posts
    22
    I am so sorry, NBVC. I think i have create a lot of inconvenience to u as i do not understand what u were doing for the previous times. I think i am just a starter so i will figure everything myself slowly. I would like to thank you lots for answering my question.

    I will post again if i still do not uderstand. Thanks

  9. #9
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636
    Note:

    The LOOKUP() formula I used, is similar to a VLOOKUP() formula.

    One good thing about Excel is that you don't always necessarily need to reference a specific table using these functions. If the "table" would be small enough (like in your example, you only have 3 lookup values and 3 corresponding results), then you can incorporate these right into the formula instead of creating a side table in the spreadsheet.

    As arthurbr pointed out, the items between the { } brackets are the lookup values and the corresponding result values.

    Syntax:

    =LOOKUP(lookup_value,{lookup items},{corresponding results})

    This function works on finding the closest match that is smaller than or equal to the lookup value... so if you enter a number between the lookup items values, then it will return the result that corresponds to inbetween the the lookup items list.

    The only things to watch out for is that the lookup items must be in ascending order.

    See LOOKUP function in Excel help for more details and examples.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

+ 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.2.0