+ Reply to Thread
Results 1 to 4 of 4

Sorting multiple tables on one worksheet

  1. #1
    Registered User
    Join Date
    12-20-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    2

    Sorting multiple tables on one worksheet

    I have a series of independent tables on one worksheet, taking the same columns (column A and B). What I need to do is find the max column B value of each respective table, and report that value and its associated column A value. Each set of tables is separated by a row of dashes. Is there a way to automate this? The tables in each worksheet have the same number of rows, but there are other worksheets that have multiple tables also that I would like to reuse the automation process on. Thanks in advance.

  2. #2
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Sorting multiple tables on one worksheet

    Not sure this meets all your criteria, but it works particularly weel if all your tables are -- at least initially -- the same number of rows.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    12-20-2010
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2003, 2007
    Posts
    2

    Re: Sorting multiple tables on one worksheet

    The macro works, but is there a way to introduce the reference to the number of rows as a variable? For example, something along the lines of ..

    X=24
    =INDEX(A1:B103,MATCH(MAX(B1:B[1+X]),B1:B[1+X],0),1)

  4. #4
    Forum Contributor bentleybob's Avatar
    Join Date
    02-27-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    644

    Re: Sorting multiple tables on one worksheet

    If you're concerned about adding rows, just extend the reference from B1:B7 to B1:B8. That way, if you add rows above the formula (currrently in B9), the range expands.

    Another option is to use dynamic range names, but the formula needs to be moved (say, to Column C). To do this, define a new range name (say, "Table1") and, in the "refers to" box, type:

    =offset($B$1,0,0,COUNTA($b:$b))

    Then change the two references in your formula from B1:B7 to Table1.

+ 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