+ Reply to Thread
Results 1 to 6 of 6

Finding n-th largest value in a database, column given by another cell

  1. #1
    Registered User
    Join Date
    11-21-2013
    Location
    Leiria, Portugal
    MS-Off Ver
    Excel 2013
    Posts
    3

    Finding n-th largest value in a database, column given by another cell

    I'm having a lot of trouble to get around this one!

    A have a large database of sales by client, with each row for a different cliente and each column representing one month of the year in a "jan/13", "feb/13", ..., format.
    I know how to identify the n-th lasgest value in each of the columns with the large function, but I want to make it easier to determine it each month, without having to add unnecessary stuff to my workbook, since I only need to have this info once a month and only for 1 month at a time, but for quite a number of different databases...

    In a different sheet, I want to be able to input the month/year in a given cell (say A1), so that a table below automatically updates the top 10 clients for the input month/year, without having to change the column used in the large function's formula range.

    I've done similar stuff to replace the vlookup function, using the match function to give me the column number I need, but in this case I don't see how I can input a column number into a function that works in a similar way to the large function.

    Any help would be very appreciated!!

    Thanks

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Finding n-th largest value in a database, column given by another cell

    Hi and welcome. Due to formatting possiblities,it is best to attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  3. #3
    Registered User
    Join Date
    11-21-2013
    Location
    Leiria, Portugal
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Finding n-th largest value in a database, column given by another cell

    Ok, so here goes a file where I try to demonstrate what I need!

    Sample sales.xlsx

    On the "Top" sheet, I would like the ranges C7:C16 and H7:H16 to update automatically when I change C2 to any other month of the year (november and december do not have any data yet).

    So far, to change these ranges to any other month I have to manually replace the L column in the LARGE funcion to the reference column I want on the "Sales" sheet...

    If you could give me any help it would be great =)

    Thanks

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Finding n-th largest value in a database, column given by another cell

    In this workbook, the date is tied to the columns to be retrieved for both the max and min arrays. A drop down list has been created for the dates. Just select a date and the data is filled in.
    Attached Files Attached Files
    Last edited by newdoverman; 11-22-2013 at 10:44 AM.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  5. #5
    Registered User
    Join Date
    11-21-2013
    Location
    Leiria, Portugal
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Finding n-th largest value in a database, column given by another cell

    I actually am struggling to understand the solution you came up with, I did not understand the way you tied the date to the columns, but anyways that posed me another problem... in several cases I don't want to LARGE function to go through all the lines in the table, just part of them...

    So, I started to play around with other functions and reached a good solution which is maybe easier to understand and does not require any additional items. It combines an OFFSET function with a MATCH function to determine how many columns the offset reference should advance.

    In the attached file you can see how it works =)

    Thank you so much for your help, it helped me address the problem in a different way!

    Sample sales.xlsx

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Finding n-th largest value in a database, column given by another cell

    Glad to help. Thank you for the feedback.

    I added a working Drop Down list to C2 of your worksheet that is based on your column headers...hope that is ok with you.

    The solution that I gave you made use of named ranges. All the date columns on the Sales worksheet were assigned names. These names were a form of the date that you have in C2 of the Top worksheet. That date however is not a legal name for a named range so on sheet1! I created a VLOOKUP table that converted the date to a legal name for named ranges. This name was then used indirectly via Sheet1!E1 with the large function to extract the records required.

    This system is easily expanded as dates are added.
    Attached Files Attached Files
    Last edited by newdoverman; 11-22-2013 at 10:58 AM.

+ 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. Finding Largest Value in Column B with Given Criteria in Column A
    By ichbinwesley in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-04-2013, 01:39 AM
  2. [SOLVED] Finding largest combination of cell values
    By omni72 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-22-2012, 04:13 PM
  3. Finding largest value in subsequent column from matching ID numbers
    By Norsemermaid in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-29-2011, 11:27 AM
  4. Finding 2nd Largest # in a Column
    By sighlent1 in forum Excel General
    Replies: 5
    Last Post: 07-21-2011, 04:16 AM
  5. function for finding largest value from cell that are not in array
    By ZOHAR in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-03-2011, 07:31 AM

Tags for this Thread

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