+ Reply to Thread
Results 1 to 17 of 17

Find the best seller??

  1. #1
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Find the best seller??

    Hey this is hard to explain, I want a 'Top sellers' table.

    So for example,

    item 1 sold 23
    item 2 sold 333
    item 3 sold 1


    I want a cell that says

    Best Seller - item 2

    I can find the highest number by doing =max(range) but I don't want the higest number in my best sellers table, I want what the item is called.

    It's hard so example so I've attached said sheet below. I've highlighted the best seller table in RED.

    Thank in advance,
    Attached Files Attached Files

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Find the best seller??

    Hows this:
    PHP Code: 
    =INDEX(B7:B34,MATCH(MAX(C7:C34),C7:C34),0

  3. #3
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Re: Find the best seller??

    Returns an error, not sure what's being done there.

    ---------- Post added at 11:56 PM ---------- Previous post was at 11:51 PM ----------

    Sorry my bad works fine.

    Whats happening there? What does the index refer too?

  4. #4
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Find the best seller??

    It's a bit like a Vlookup.

    The Match returns the line number of the Maximum value found. Index takes that line number and returns that number from B7:B34

  5. #5
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Re: Find the best seller??

    Thanks Kyle!

  6. #6
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Re: Find the best seller??

    Sorry I have to re-open this, the index formula isn't working when I'm putting in different data. How can I do this via VLOOKUP?

    Thanks,

  7. #7
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Find the best seller??

    Hi benwall

    It works, what other data are you putting in and where.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Re: Find the best seller??

    I've extended the table and tweaked it slightly and after copying in fresh data it doesn't work. It just seems quite unstable or maybe it's just me being stupid.

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Find the best seller??

    You can't use VLOOKUP if the column you are searching is to the right of the column you want returned. INDEX is a very stable function and is used in some very complex lookups so there has to be an error elsewhere. Is it giving an error or returning the wrong value? If you're updating ranges, make sure you update all three ranges within the INDEX Function you were given.

    If you post your "tweaked" formula, we might be able to see what's wrong with it
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  10. #10
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Re: Find the best seller??

    Helo,

    I've uploaded two files the first one labelled 'Orignal' works fine.

    The second one called 'Original2' I've changed the formulas in 'Items Sold' column which shouldn't effect the index area but it does and it no longer works.

    Any help is appreciated.

    Thanks,
    Attached Files Attached Files

  11. #11
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Find the best seller??

    Note the 0 in the match function

    PHP Code: 
    =INDEX(C6:C61,MATCH(MAX(D6:D61),D6:D61,0),0

  12. #12
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Re: Find the best seller??

    What does the 0 relate to?

  13. #13
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Find the best seller??

    An exact match

  14. #14
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Re: Find the best seller??

    Sorry for being thick here. How does changing the items sold column mean it doesn't work because of the 0?

  15. #15
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Find the best seller??

    Because by default the function uses 1 rather than 0, this means it returns the largest value that is less than or equal to the lookup, however your data must be sorted in ascending order. Using forces an exact match - the original function I gave you should have had a 0 in too, but I missed it out

  16. #16
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Re: Find the best seller??

    Arr ok.

    Thanks.

  17. #17
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Re: Find the best seller??

    Thanks Kyle.. appreciated.

+ 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