Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to create a table from another table

I have a master table in Numbers. I want to make smaller tables that show filtered data from this table. For example, in the screenshot, I made a small table listing items to buy from 3 different stores. Now I need to make 3 other sheets, each one showing all the same data, but only for 1 store. (One table showing what is purchased from Walmart, from Kroger, etc). I'm guessing I want to link the 3 smaller tables to the master somehow, but can't figure it out.

Thanks.User uploaded file

Mac OS X (10.7.3)

Posted on Sep 16, 2013 6:30 PM

Reply
20 replies

Sep 16, 2013 8:21 PM in response to SouthernAtHeart

Here's one way:

User uploaded file

Table 1 ("Data") is a simplified version of your example table.


Table 2 ("W") shows the purchases made at store W.


Data requires an added column, "index", which is a 'working' column, necessary to the action, but not to the eye. it may be hidden.


There is one formula used to create the index:


E2, and filled down: =D&COUNTIF($D$2:D2,D)


The table "W" also contains one formula, entered into A2, and filled down column A, and rigth to column D. Note that if you define column A as a header column, it will be necessary to Copy A2, then select B2 and go Edit > Paste and Match Style to get the formula across the boundary between Header column and Body columns. From B2, it can be filled down and Right to D14 (or further down, depending on the number of purchases from W).


A2, and filled down, B2, and filled down and right: =IFERROR(OFFSET(Data :: $A$1,MATCH($A$1&ROW()-1,Data :: $E,0)-1,COLUMN()-1),"")


Duplicate the table W for each store from which you have purchased, then replace the name "W" in A1 of the duplicate table with the name of a different store.


Regards,

Barry

Sep 17, 2013 1:12 PM in response to Barry

Thanks so much!

I've started by inserting a column on the end with this:

=D&COUNTIF($D$2:D2,D) and filling all the way down.

It works fine, except when I categorize the master list that index column gets all messed up. And when I deleted categories, it was still messed up. See screenshot:

I'll continue working on setting up the new table(s), but it will be nice to be able to view the master table with catergories.

Thanks

User uploaded file

Sep 17, 2013 3:10 PM in response to SouthernAtHeart

SAH,


It would probably be a good idea to forego using the Categories feature of Numbers tables is you are also indexing for the purpose of doing breakout reports. I will say though that if you are going to be sorting and editing your main data table, there is probably a better formula for creating the index. It's more complex, but avoids problems with sorting.


Where Barry has given you "D&COUNTIF($D$2:D2,D)" for column E, which works fine if you don't sort, I would suggest the following:


D&COUNTIF(OFFSET($D$1, 0,0,ROW()),D)


If you try this expression and still have trouble, you're welcome to send me your file and I'll see if I can tell what the problem is.


Jerry

Sep 17, 2013 4:13 PM in response to SouthernAtHeart

Charlie,


You weren't quite getting Barry's drift on the W in A1 of your breakout table. I believe he wanted you to write Wal-Mart there. "W" must be a shorthand notation.


I'm going to give you my favorite version of the expression to fetch records from the main data table:


=INDEX(Data,MATCH("Wal-Mart"&ROW()-1, Data :: $E, 0), COLUMN())


Put that in every body cell of your Wal-Mart table and see if you get what you want. It will make a copy of the rows in the main table for the specified store, based on the order in the main table. I left off the error trap since it's easier to trouble shoot without it. If you get red triangles because you have more breakout rows than data, delete those rows or reinstate the trap.


Here's a screen shot of the Data table and the Wal-Mart table with the above expression:

User uploaded file


Jerry

Sep 19, 2013 12:41 PM in response to Jerrold Green1

Thanks so much! That sure works great! A master table, and smaller tables for each purchase order!

One more question about all the zeros. Any field in the master table that is blank gives a zero on the linked table. Is it possible to edit the formula so that if it's a zero, it'll be blank? Here's my formula, for the table I attatched an image of:

=INDEX(Complete Order,MATCH("Sams"&ROW()-2, $INDEX, 0), COLUMN())


User uploaded file

Sep 19, 2013 12:50 PM in response to SouthernAtHeart

SAH,


You could do that, but the preferred way, in my experience, would be to conditionally format the output in the Cells Inspector such that the zero result is grayed out, completely to white if you prefer. My preference would to set the opacity to about 10% for ther zero case. Low enough to not draw your attention to the zeros, but high enough that you can tell that there is a result there.


Jerry

Sep 19, 2013 11:31 PM in response to Jerrold Green1

"You weren't quite getting Barry's drift on the W in A1 of your breakout table. I believe he wanted you to write Wal-Mart there. "W" must be a shorthand notation."


Not so much a shorthand as an effort to reduce the typing necessary to provide a working example, and to make the index values for the example short so the reulting table would be readable in the scren shot. The W is just a piece of text, as are the single letters identifying the 'product', and the numbers showing the 'quantities'.


Your belief regarding replacing W with Wal-Mart is correct—the text in cell A1 of each samll table must match the text identifying the store to be summarized in that table.


Regards,

Barry

Aug 26, 2014 6:58 AM in response to SouthernAtHeart

I am trying to figure out why I can't get this to work again. After updating to the recent numbers. I lost the table fills. I've tried starting over with a simple table, but I get an error message about "the formula contains an invalid reference" when I paste in the formula: =INDEX(Complete Order,MATCH("Sams"&ROW()-2, $INDEX, 0), COLUMN())


I can share a copy of my test file if there's a way to do it.


SouthernAtHeart


edit: Here's a link to the test file I tried to get working.

https://www.dropbox.com/sh/3j9bqt6xpulkky3/AABToFb3oKw8b1rmL-Wvw3aKa?dl=0

Aug 26, 2014 9:50 AM in response to SGIII

I must be really dumb! I tried to do this, but it doesn't seem to work. I copied that line exactly like this:

=INDEX(Complete Order::$A:$G,MATCH("Sams"&ROW(cell)−1, Complete Order::$G,0), COLUMN(cell),area-index)

...and pasted it in a cell in my second table, but any cell I put it in it give me an error. See the photos. the first one, I've pasted in the formula, but haven't hit the green checkmark yet. The second one is when I have.

User uploaded file

User uploaded file

How to create a table from another table

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