Numbers : How to copy entire rows of data matching one criteria.

I have a main table which is like this.

Column 1 - Student Name

Column 2 - Sport (Swimming, Football, Tennis etc...)

Column 3 - Score they had in each sport.


Now, I need to make different tables for different sports. For example, A table for Tennis with all the students name and their score. So, I need around 6 tables for 6 different sports.

What is the formula will I use for creating those different tables if I want those 6 tables to get updated automatically whenever add a students name in main table?


Posted on Feb 12, 2021 9:44 AM

Reply
12 replies

Feb 13, 2021 5:50 AM in response to pheonix2610

Don't forget that you don't even need to use an extra column and a formula to do this if you take advantage of the built-in Categories feature of Numbers:





Then, to add a new player just click in the last row of a sport and hit return.


Numbers automatically fills in the category (sport) for you and you fill in the rest of the row.





If you need to calculate a statistic (average, minimum, maximum for each sport just enter it here after clicking the 'gear' symbol:




SG

Feb 14, 2021 1:07 AM in response to Barry

pheonix2610 wrote:

But, I don't want my swim students to see the score of Tennis students while I categorise and sort the data. I would rather switch the sheets to show them each of their scores.


That's when a copy Paste and Match Style works really well. Set up your swim table, your tennis table, etc. and format as desired. Then to update just select, command-c, click in the destination table and Edit > Paste and Match Style. The destination tables will expand automatically to accept your data. Twenty different sports? Still done in about a minute. Fewer sports? Done even quicker.


SG

Feb 13, 2021 11:55 PM in response to pheonix2610

Hi phoenix,


"find value" is what Numbers provides if you/ve written the formula by choosing the type of MATCH from the menu provided in that 'hint'. Clicking the disclosure triangle near the riht end of the lozenge opens a menu showing the available choices. Entering a zero in that position has the same effect—MATCH will accept only an exact match for the search value, which is what you want in this case.


Automatic addition of new rows as needed is not a supported feature in Numbers. Set these tables to the number of rows you expect to need, then add rows any time the table gets close to being full. As you've noted, the formula gets automatically filled into those new rows. If that fails to happen, you can use the Fill control (small yellow circle that appears on a cell edge when you bring the pointer close to the edge of the cell in the direction you want to fill) to manually fill the formula down as far as it is needed.


Regards,

Barry

Feb 12, 2021 11:53 AM in response to pheonix2610

Hi phoenix,


Add a column to the main table to contain an index, giving each row a distinct datum which can be searched.

The formula shown below the table is entered in D2, then filled down to the end of that column.


B2 gets the value in 'this row' of column B.

COUNTIF counts the occurrences of the value in 'this row' of column B in the (expanding) range of B1 to 'this row' of B.

The concatenation operators ( & ) join the contents of B2, a space, and the count returned by COUNTIF into a single string, and return that string to the cells containing the formula.


The formula shown in entered in B2 of the smaller table to the left, and is filled down to the end of that column.

The same formula, with "Table 1::C" replaced by "Table 1::A" is placed in cell A2 and filled down.


The second small table is a copy of the selected one, with a different sport entered in cell A1.


The core formula here is the part beginning with INDEX


A1 gets the sport name, Row gets the row number of 'this row', one is subtracted from it. The sport name, a space and the number are joined to form a search value (Swim 1) for MATCH.

MATCH looks for that value in column D of Table 1, and returns a number indocating it's position in the list in that column.

INDEX takes the number and returns the value in that row of column C of Table 1.


Search values not found will cause an error message from MATCH. This is trapped by the IFERROR function in which the core formula is wrapped, and IFERROR returns a null string, which appears 'blank' in the cell.


Regards,

Barry

Feb 13, 2021 8:27 PM in response to Barry

One follow up question,


Everything is working perfect except the seperate individuals tables created are not adding rows automatically whenever I add items in main table.


Once the initial rows are filled, it does not anymore new rows. But, if add more rows manually, the formula is filled automatically and everything is perfect again. So, how do I make them to add more rows automatically.


Also, in the second formula, how do I type "find value" in the formula


Maybe not creating rows automatically is because of this omission.

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.

Numbers : How to copy entire rows of data matching one criteria.

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