+ Reply to Thread
Results 1 to 5 of 5

Reference a moving cell in another table

  1. #1
    Forum Contributor
    Join Date
    03-29-2013
    Location
    US
    MS-Off Ver
    Office 2016
    Posts
    109

    Reference a moving cell in another table

    I have a worksheet that contains two tables, one above the other. The first table is constantly being resorted (through the use of a macro). The second table is intended to be a summary of the first and each cell contains a simple formula that takes two specific cells in the first and averages them.

    The problem is that when the first table is resorted, the references don't change in the second table, and they then point to cells in the wrong row. Using absolute references doesn't help.

    Is there a solution to this? I don't think moving the second table to another worksheet would solve anything, but maybe that's wrong.

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

    Re: Reference a moving cell in another table

    Please upload an example of what you have and someone (maybe even me) will provide a solution.

  3. #3
    Forum Contributor
    Join Date
    03-29-2013
    Location
    US
    MS-Off Ver
    Office 2016
    Posts
    109

    Re: Reference a moving cell in another table

    Try this. The intention of the second table would to add the totals from two rows in the first table representing sales teams. To sort the first, uses Ctrl+Shift+S.
    Attached Files Attached Files

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Reference a moving cell in another table

    Try this UDF...

    Please Login or Register  to view this content.
    In C22 Cell
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Drag it down and right...
    Last edited by :) Sixthsense :); 05-31-2013 at 01:27 AM. Reason: Applied Code Tag


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: Reference a moving cell in another table

    I took a slightly different approach to Six.

    I made up a table with your names, and gave each "color" a number. Then I used vlookup() to apply that number to the name (it should work no matter how the sort goes)
    Then I used sumif() to run the calcs for you. Your sample calc adds values from the total column, I assumed you wanted to add totals for each month.
    Attached Files Attached Files
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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