transfer cell from one sheet to another, but lock it to that content, no matter how its sorted

Okay, here is what I am trying to do. This is a sports spreadsheet with stats, etc. The main sheet has ALL the positions listed (PG, SG, SF, PF, C). Then I have 5 other sheets for each position broken down, one for PG, one for SG, etc. By using the "=" and referencing the main sheet, I make it so any changes made on the main sheet will automatically show up in the corresponding cell on the position sheet. The problem is, if I change the sorting on the main page, the cells being referenced changes, thus changing all the other sheets. Is there a way to "lock" into a single row to reference so that no matter where it gets sorted, it remains the same on the corresponding sheet?


And while I'm at it. Is there a way for the sort function to sort every page the same? For example, if I sorted the main page by descending for the "Points" column, then all the other sheets also get sorted by the "points" column as well.


Thank you in advance.

iMac, OS X El Capitan (10.11.1)

Posted on Dec 9, 2016 9:14 PM

Reply
8 replies

Dec 9, 2016 9:53 PM in response to LamboDaKing77

Hi Lambo,


"Is there a way to "lock" into a single row to reference so that no matter where it gets sorted, it remains the same on the corresponding sheet?"


"it" appears twice in your question. What is "it" in the first case? What is "it" in the second case?


Do you mean you want the cell on the receiving table to always get its data from the same row (eg. Row 2) of the source table?


INDEX, using a fixed value for the row-index, will do that.


Or do you mean when a sort of the source table moves Joe Smith from row 7 to row 3, you want his data to be displayed on row 5 or the receiving table before the sort AND after the sort?


INDEX, using MATCH to calculate the row-index will do that.


A screen shot of the table supplying the data and one of the table receiving the data plus a description of what's getting sorted and what's to remain the same would help in arriving at a formula specific to your table set.


Regards,

Barry

Dec 10, 2016 9:30 PM in response to Barry

I think the second scenario is more of what I'm looking for, but I don't think "match" will work. Here are some screen shots to help make it easier to understand...

User uploaded file

This is the "All" sheet. As you can see it has multiple positions listed PG, SG, SF, etc. I want a separate sheet for PGs only and SGs only, etc. which currently I copy/paste them into to their own sheet, but if I was to change something on the "all" page, it doesn't change on the other sheets.


I found by using just "=" and selecting the correct cell, I could mirror all the data until its own sheet, but it points to only that cell, so if I were to resort the "all" page, it would change everything on the other pages incorrectly.


I want to be able to link the content so that no matter how I sort the "all" page, the data on the other pages remains unchanged.

Dec 10, 2016 11:58 PM in response to LamboDaKing77

Hi Lambo,


So, as I understand it, you want to have a separate table for each position, and you want to transfer the data in each row of the ALL table to the table for the position.


Not a difficult process, but it will require adding an index column for each position to the ALL table.


Each Table may be on a separate Sheet, if desired, but it is the Table, not the Sheet that will contain the data. Numbers Sheets are, simply put, the blank canvas onto which are placed the Tables, Charts, Graphic object, Text boxes etc. that make up the Spreadsheet document.


Here's a sample, using the data from your 'ALL' table, edited to reduce the typing necessary to produce the table, and with the 'ALL' table renamed "Main" to shorten the display of the formulas. Four of the five 'Position' tables are shown. The fifth is missing only to reduce the space needed for the image.

User uploaded file

Columns H-L have been added to provide indices for each of the positions. These columns may be hidden.


The indices are created using the formula below, entered into H4, then filled down to the end of the table, and filled right to column L.


H4: IF($C=H$3,MAX(H$3:H3)+1,"")


The column reference $C remains constant as the formula is filled right; the references to column H adjust to match the column containing each iteration of the formula.


Each of the Position tables contains a single formula, entered in A4, then filled down and filled right to the ends of the columns and rows of that table. The formulas for each table differ only in the two references to the column containing the index values for that position.


PG::A4: IF(ROW()−3>MAX(Main::$H),"",INDEX(Main::$A:$G,MATCH(ROW()−3,Main::$H,0),COLUMN( )))

SG::A4: IF(ROW()−3>MAX(Main::$I),"",INDEX(Main::$A:$G,MATCH(ROW()−3,Main::$I,0),COLUMN( )))

SF::A4: IF(ROW()−3>MAX(Main::$J),"",INDEX(Main::$A:$G,MATCH(ROW()−3,Main::$J,0),COLUMN( )))

PF::A4: IF(ROW()−3>MAX(Main::$K),"",INDEX(Main::$A:$G,MATCH(ROW()−3,Main::$K,0),COLUMN( )))

C::A4: IF(ROW()−3>MAX(Main::$L),"",INDEX(Main::$A:$G,MATCH(ROW()−3,Main::$L,0),COLUMN( )))


The IF part of the formula; IF(ROW()−3>MAX(Main::$z),"",formula)

tests to find if all index values for this position have already been transferred. If TRUE, the formula places a null string ( "" ) in the cell; if FALSE, the formula returns the data from the indexed row.


For details on INDEX, MATCH, ROW() and COLUMN(), see the articles in the Function Browser. To open the browser, click any cell in a table, then press =.


Regards,

Barry

Dec 11, 2016 10:56 PM in response to LamboDaKing77

Hi Lambo,


I agree with Barry that an index is the way to go with this. It will update itself when the data in your main table changes.

Here is a solution that only requires a single index column.

User uploaded file

The formula in row 2 of the index column is:

C2&COUNTIF(C$2:C2,C2)

This is filled down.


For your report table(s):

User uploaded file

In my report table

A3= INDEX(Table 1::A,MATCH($A$1&ROW(cell)−2,Table 1::$F,0))

This is filled down and to the right.


As a little twist I put a popup menu in A1 so this single table can access any position.

If you are devoted to single tables for each position, Row 1 can be eliminated and the formula for my "sg" table

A2= INDEX(Table 1::A,MATCH("sg"&ROW(cell)−1,Table 1::$F,0))

The reference to $A$1 is replaced by "sg" and the row reference ROW()-2 is changed to ROW()-1.


I would add a filter to hide the error rows.


quinn

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

transfer cell from one sheet to another, but lock it to that content, no matter how its sorted

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.