Consulting

Results 1 to 7 of 7

Thread: Solved: Vlookup and negative numbers

  1. #1

    Solved: Vlookup and negative numbers

    Hi,

    In order to show numbers in percentages (from 0,00 to 1,00) in colours I created the following Name (clsValues) where cls are asigned to colours.

    0 cls1
    0,2 cls2
    0,35 cls3
    0,5 cls4
    0,6 cls5

    I used =VLOOKUP(data;clsValues;2;TRUE) and it worked well.

    Now I'm trying to assign colours to percentages including negative percentages (from -1,00 to 1,00).

    I created a Name called "clsValues" and used "
    =VLOOKUP(Data;clsValues;2;TRUE)
    "

    -0,1 cls1
    -0,03 cls2
    0,03 cls3
    0,03 cls4
    0,1 cls5

    But I get an error. How can I handle vlookup, and negative %?

    Thanks!!!!!!

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    It is working fine for me, as I understand what you are saying. Can you post a workbook?
    ____________________________________________
    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
    Hi,

    Ok. Find attached the workbook. Table2Value is the one that doesn't work.

    Thanks!!

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    The lookup value 04DIG doesn't exist in Table2Values, so it is no wonder it fails.
    ____________________________________________
    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
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    =VLOOKUP(gainvalue,table2Values,2,TRUE)

    works fine.
    ____________________________________________
    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

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    or even

    =VLOOKUP(VLOOKUP(region,Data,3),table2Values,2,TRUE)
    ____________________________________________
    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

  7. #7
    Thanks!!!! You were right!

Posting Permissions

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