+ Reply to Thread
Results 1 to 20 of 20

Lookup from table in descending order

  1. #1
    Forum Contributor
    Join Date
    07-24-2013
    Location
    HongKong
    MS-Off Ver
    Excel 2010
    Posts
    237

    Lookup from table in descending order

    Dear all,

    ScreenHunter_005.jpg

    Whenever I input a figure at E4, the name with Mark equal or smaller than E4 are list out in E5:E8 in descending order. What is the formula please?
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    11-21-2015
    Location
    Philippines
    MS-Off Ver
    Microsoft Office 2016
    Posts
    146

    Re: Lookup from table in descending order

    Quote Originally Posted by kent97 View Post
    Dear all,

    Attachment 484188

    Whenever I input a figure at E4, the name with Mark equal or smaller than E4 are list out in E5:E8 in descending order. What is the formula please?
    Yes, it's:

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    07-24-2013
    Location
    HongKong
    MS-Off Ver
    Excel 2010
    Posts
    237

    Re: Lookup from table in descending order

    Quote Originally Posted by tamthat View Post
    Yes, it's:

    Please Login or Register  to view this content.
    Hi,

    1. The results should be David, Peter, Jane & Judy. But your formula comes out David, Peter Judy & Mary.

    2. If The mark of David is 71, the results should be Peter, Jane, Judy & Tom. Your formula results in all "N/A"

  4. #4
    Forum Contributor
    Join Date
    11-21-2015
    Location
    Philippines
    MS-Off Ver
    Microsoft Office 2016
    Posts
    146

    Re: Lookup from table in descending order

    Quote Originally Posted by kent97 View Post
    Hi,

    1. The results should be David, Peter, Jane & Judy. But your formula comes out David, Peter Judy & Mary.

    2. If The mark of David is 71, the results should be Peter, Jane, Judy & Tom. Your formula results in all "N/A"
    Yes, i see
    Last edited by tamthat; 10-10-2016 at 11:59 PM.

  5. #5
    Forum Contributor
    Join Date
    11-21-2015
    Location
    Philippines
    MS-Off Ver
    Microsoft Office 2016
    Posts
    146

    Re: Lookup from table in descending order

    Quote Originally Posted by kent97 View Post
    Hi,

    1. The results should be David, Peter, Jane & Judy. But your formula comes out David, Peter Judy & Mary.

    2. If The mark of David is 71, the results should be Peter, Jane, Judy & Tom. Your formula results in all "N/A"
    Please Login or Register  to view this content.
    Ctrl + Shift + Enter!
    Last edited by tamthat; 10-10-2016 at 11:58 PM.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,750

    Re: Lookup from table in descending order

    Try this array entered formula (Ctrl + Shift + Enter)
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,750

    Re: Lookup from table in descending order

    My previous formula works for 70 but fails for 99. This one does not.

    With a helper column in G5:G8 this array formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    then this array entered formula in F5:F8
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    With 70 as the criteria:

    Row\Col
    B
    C
    D
    E
    F
    G
    2
    Data Result
    3
    4
    Name Mark
    70
    5
    Alice
    6
    David David
    70
    6
    Tom
    27
    Peter Peter
    66
    7
    Jane
    34
    Jane Jane
    34
    8
    David
    70
    Judy Judy
    34
    9
    Peter
    66
    10
    Judy
    34
    11
    Mary
    5
    12
    Kent
    99



    With 99 as the criteria:

    Row\Col
    B
    C
    D
    E
    F
    G
    2
    Data Result
    3
    4
    Name Mark
    99
    5
    Alice
    6
    David Kent
    99
    6
    Tom
    27
    Peter David
    70
    7
    Jane
    34
    Jane Peter
    66
    8
    David
    70
    Judy Jane
    34
    9
    Peter
    66
    10
    Judy
    34
    11
    Mary
    5
    12
    Kent
    99

  8. #8
    Forum Contributor
    Join Date
    11-21-2013
    Location
    zimbabwe
    MS-Off Ver
    Excel 2003
    Posts
    125

    Re: Lookup from table in descending order

    Here it is
    Formula for cell E5
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Confirm with the Keystroke CTRL+SHIFT+ENTER
    Copy down

  9. #9
    Forum Contributor
    Join Date
    11-21-2015
    Location
    Philippines
    MS-Off Ver
    Microsoft Office 2016
    Posts
    146

    Re: Lookup from table in descending order

    Quote Originally Posted by soledad View Post
    Here it is
    Formula for cell E5
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Confirm with the Keystroke CTRL+SHIFT+ENTER
    Copy down
    Great! Thanks!

  10. #10
    Forum Contributor
    Join Date
    07-24-2013
    Location
    HongKong
    MS-Off Ver
    Excel 2010
    Posts
    237

    Re: Lookup from table in descending order

    Quote Originally Posted by tamthat View Post
    Please Login or Register  to view this content.
    Ctrl + Shift + Enter!
    Yours still has some problem??

  11. #11
    Forum Contributor
    Join Date
    07-24-2013
    Location
    HongKong
    MS-Off Ver
    Excel 2010
    Posts
    237

    Re: Lookup from table in descending order

    Hi FlameRetired,

    Thanks so much for your patience and detailed answer.

  12. #12
    Forum Contributor
    Join Date
    07-24-2013
    Location
    HongKong
    MS-Off Ver
    Excel 2010
    Posts
    237

    Re: Lookup from table in descending order

    Quote Originally Posted by soledad View Post
    Here it is
    Formula for cell E5
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Confirm with the Keystroke CTRL+SHIFT+ENTER
    Copy down
    I think I can never write such a complicated formula by myself, thank you soledad

  13. #13
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,750

    Re: Lookup from table in descending order

    Thank you for the feedback.

  14. #14
    Forum Contributor
    Join Date
    07-24-2013
    Location
    HongKong
    MS-Off Ver
    Excel 2010
    Posts
    237

    Re: Lookup from table in descending order

    Hi,

    By using this formula,

    =LOOKUP(1,1/(LARGE((C$5:C$12<=E$4)*RANK(C$5:C$12,C$5:C$12,1)*ROW($12:$12)-ROW($5:$12),ROWS($1:1))=RANK(C$5:C$12,C$5:C$12,1)*ROW($12:$12)-ROW($5:$12)),B$5:B$12)

    I can find out the name with Mark equal or smaller than E4 are list out in E5:E8 in descending order.

    How about if I want to find out the name with Mark equal or LARGER than E4 and list out in E5:E8 in ASCENDING order.

    ScreenHunter_007.jpg

  15. #15
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,750

    Re: Lookup from table in descending order

    soledad appears to be logged off at this time.

    I tried doing this with soledad's formula and it works with one possible glitch.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    With 34 in 'Mark' it returns the correct people, but with Jane and Judy in the same relative order as when 'Mark' was equal or SMALLER than E4. Try it (array entered) and see what I mean.

    Presently I don't know how to resolve this part of soledad's formula. Will it work just the same?

  16. #16
    Forum Contributor
    Join Date
    07-24-2013
    Location
    HongKong
    MS-Off Ver
    Excel 2010
    Posts
    237

    Re: Lookup from table in descending order

    Quote Originally Posted by FlameRetired View Post
    soledad appears to be logged off at this time.

    I tried doing this with soledad's formula and it works with one possible glitch.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    With 34 in 'Mark' it returns the correct people, but with Jane and Judy in the same relative order as when 'Mark' was equal or SMALLER than E4. Try it (array entered) and see what I mean.

    Presently I don't know how to resolve this part of soledad's formula. Will it work just the same?
    Hi FlameRetired,

    That minor glitch doesn't matter too much. The question I raise up is a simplified version, I have to modify the formula to fit my purpose. I feel faint when looking at it @@@
    Thank you so much for your kind assistance.

  17. #17
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,750

    Re: Lookup from table in descending order

    You are welcome, but soledad did all the "heavy lifting" on this one.

  18. #18
    Forum Contributor
    Join Date
    11-21-2013
    Location
    zimbabwe
    MS-Off Ver
    Excel 2003
    Posts
    125

    Re: Lookup from table in descending order

    Quote Originally Posted by kent97 View Post
    Hi,
    How about if I want to find out the name with Mark equal or LARGER than E4 and list out in E5:E8 in ASCENDING order.
    In this case you use the following formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    You can replace the function SMALL by function LARGE if you wish to order by descending
    Also, you can rewrite the formula in case Mark equal or SMALLER than E4 as following
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Hope it helps

  19. #19
    Forum Contributor
    Join Date
    11-21-2015
    Location
    Philippines
    MS-Off Ver
    Microsoft Office 2016
    Posts
    146

    Re: Lookup from table in descending order

    Quote Originally Posted by FlameRetired View Post
    soledad appears to be logged off at this time.

    I tried doing this with soledad's formula and it works with one possible glitch.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    With 34 in 'Mark' it returns the correct people, but with Jane and Judy in the same relative order as when 'Mark' was equal or SMALLER than E4. Try it (array entered) and see what I mean.

    Presently I don't know how to resolve this part of soledad's formula. Will it work just the same?
    You should attach your file. I do not think that is the problem

  20. #20
    Forum Contributor
    Join Date
    07-24-2013
    Location
    HongKong
    MS-Off Ver
    Excel 2010
    Posts
    237

    Re: Lookup from table in descending order

    Quote Originally Posted by soledad View Post
    In this case you use the following formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    You can replace the function SMALL by function LARGE if you wish to order by descending
    Also, you can rewrite the formula in case Mark equal or SMALLER than E4 as following
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Hope it helps
    I have tried as what you did before, but I didn't replace the "+" sign to "-", so I got the wrong result.
    Thanks a lot!

+ 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. Pivot Table descending sort order of (Blanks) + VBA
    By bezwlosy in forum Excel Charting & Pivots
    Replies: 12
    Last Post: 09-09-2014, 07:38 AM
  2. Pivot table to show certain column in descending order
    By rushdenx1 in forum Excel General
    Replies: 1
    Last Post: 01-04-2012, 05:32 AM
  3. Excel 2007 : Extract by descending order
    By Shilpa kanchan in forum Excel General
    Replies: 1
    Last Post: 12-25-2011, 03:53 AM
  4. vlookup in descending order
    By thebigmancometh in forum Excel General
    Replies: 1
    Last Post: 02-16-2010, 06:13 AM
  5. Lookup function and dates in descending order
    By snowy08 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-10-2010, 03:20 PM
  6. Rank Table in descending order
    By Merv in forum Excel General
    Replies: 6
    Last Post: 12-17-2009, 01:22 PM
  7. Sort in descending order
    By shahcu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2008, 03:01 AM

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