+ Reply to Thread
Results 1 to 4 of 4

Need VLOOKUP alternative for duplicate values

  1. #1
    Registered User
    Join Date
    02-02-2006
    Posts
    11

    Need VLOOKUP alternative for duplicate values

    Hello,
    I have a 2 columns, 1 of numbers and the other with corresponding labels:

    3.50 Label1
    3.25 Label2
    2.75 Label3
    3.25 Label4
    2.00 Label5
    ...

    In my final output, i need to get the 4 Labels corresponding to the lowest values in the above list. Right now I am using the SMALL formular to get the numbers sorted in ascending order, then using a VLOOKUP on each of the 'SMALL' results to lookup the corresponding label. My results look like this:

    Label5 2.00
    Label3 2.75
    Label2 3.25
    *Label2* 3.25
    Label1 3.50

    As you can see, I'm almost there except for one problem: because there are duplicate values in the source data, the VLOOKUP is picking up Label2 twice where in fact I'd want it to display 'Label4' in the asterisked row above.

    Can anyone help with a simple workaround to the above?

    Much appreciated in advance.
    Ranjith

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531
    Ranjith, you can do what you want but you will invariably end up using expensive array formulae... the better option is to use a Pivot Table for this. You can easily set up a Pivot Table to show you the associated values of column 2 based on the Bottom 5 values in column 1.

    If you set Column 2 as ROW Field and Column 1 as a DATA Field (Sum)

    Then right click on of your ROW Values (eg Label1) then pending version of XL:

    Pre XL07:

    Choose Field Settings -> Advanced -> AutoSort Options -- set to Asc -> Using Field -- set to "Sum of ..." -> Top10 Auto Show -> On -> Show -- set Bottom 5 --> Using Field -- set to "Sum of..."

    XL2007:

    Click Sort -> More Sort Options -> Sort Asc based on "Sum of..."
    Right click on Label value again:
    Choose Filter -> Top10 -> Show -- set to Bottom -- 5 items -- based on "Sum of..."

  3. #3
    Forum Contributor
    Join Date
    08-21-2006
    Location
    Ossett, West Yorkshire
    MS-Off Ver
    2003
    Posts
    150

    Smile

    Hi,
    One way is to introduce a column to the left of your numbers and use the formula:

    =RANK(B1,$B$1:$B$5,1)+COUNTIF($B$1:B1,B1)-1 and drag down this will give you numbers a unique address for you to use Vlookup

    Hope this helps
    Regards Howard

  4. #4
    Registered User
    Join Date
    02-02-2006
    Posts
    11
    Thanks Howard - RANK function worked a treat. Cheers.

+ 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