+ Reply to Thread
Results 1 to 7 of 7

Sorting Issue

  1. #1
    Registered User
    Join Date
    10-22-2014
    Location
    Hyde, Manchester
    MS-Off Ver
    2010
    Posts
    79

    Sorting Issue

    Hi guys, I'm having a problem with sorting and a lookup function in excel.....

    I have a list like so:

    I1
    I2
    I3
    I4
    I5
    I6
    I7
    I8
    I9
    L1
    L2
    L3
    L4
    L5
    L6
    L7
    L8
    L9
    L10
    L11
    L12
    L13
    L14
    L15
    O1
    O2
    O3
    O4
    O5
    O6
    O7
    O8
    O9
    O10


    And when I use the lookup function it returns the wrong value because the sorting shows ,for example, L11 as being in the wrong place and hence returns the wrong value. Is there anything I can do about this?

    Regards

    Tom

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Sorting Issue

    I don't follow your explanation. can you attach a sample excel sheet showing the problem, the lookup formula, etc?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,798

    Re: Sorting Issue

    What "lookup" function are you using?

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

    Re: Sorting Issue

    The current order of the list is not in ascending order. Understand that your list is text. Consequently, L11 comes directly after L1 when sorted.
    I would either:
    • edit the list so that all trailing numbers are 2-digits: L1 would be L01, etc
    or
    • Create a "helper column", using formulas that make the trailing numbers 2-digits

    Example:
    =LEFT(A1,1)&RIGHT("00"&MID(A1,2,2),2)

    • Reference the helper column in the LOOKUP formula

    does that help?
    Last edited by Ron Coderre; 07-31-2015 at 08:37 AM.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,798

    Re: Sorting Issue

    With data in B and your list in A this will find exact match for example "O2"

    =INDEX($B$2:$B$35,MATCH("O2",$A$2:$A$35,0))

    Is this what you want?

  6. #6
    Registered User
    Join Date
    10-22-2014
    Location
    Hyde, Manchester
    MS-Off Ver
    2010
    Posts
    79

    Re: Sorting Issue

    Thanks guys, the idea to use double digits in the index has sorted it

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

    Re: Sorting Issue

    Glad you got something you can use!

    If that resolves your issue, please take a moment to mark this thread as SOLVED (from the Thread Tools menu)

+ 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] A Sorting Issue
    By vichisov in forum Excel General
    Replies: 11
    Last Post: 11-14-2013, 10:22 AM
  2. Sorting Issue
    By letangerang58 in forum Excel General
    Replies: 1
    Last Post: 05-06-2013, 12:54 PM
  3. Sorting Issue
    By Kellypeterson in forum Excel General
    Replies: 11
    Last Post: 01-19-2012, 09:01 PM
  4. Sorting issue
    By airwolf in forum Excel General
    Replies: 1
    Last Post: 02-02-2010, 12:20 PM
  5. Sorting issue
    By floribunda in forum Excel General
    Replies: 4
    Last Post: 09-02-2009, 08:26 AM
  6. Sorting issue
    By Wayne Knazek in forum Excel General
    Replies: 5
    Last Post: 10-29-2008, 04:12 PM
  7. Sorting issue
    By wizgf19 in forum Excel General
    Replies: 9
    Last Post: 06-05-2008, 08:45 AM
  8. Sorting Issue
    By Mada in forum Excel General
    Replies: 3
    Last Post: 01-23-2007, 03:54 PM

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