Numbers Mac: Automate filtering and copying by percentage

hi I am very new to Numbers ( 13.1 ) on a Mac book , I have football database a sheet for each league, each sheet has 16 columns by 24 rows what I am trying to do is get a value of a greater percentage in a column, then carry on to the the bottom of that row until all with the greater percentage are found, then copy all rows selected to another sheet. At present I do this manually but struggling to find the best way to automate it. if somebody could point me in the right direction please.

MacBook Air 13″, macOS 12.7

Posted on Jun 5, 2026 4:21 AM

Reply
7 replies

Jun 7, 2026 3:44 PM in response to Deadalus4

I can see a couple of problems with your AppleScript, but I'm going to ignore them for now, because I don't think a script is necessary here.


If you really want a scripted solution, I'm happy to dig into that, but for what I hear you're trying to do, there's a much easier way to do it.


On your Selections sheet, create a new table that is large enough to include ALL the teams in all leagues.


In cell Selections::Selections::A3, set the formula to:


=Premier::Data::8:27


This should pull the data for all Premier League teams into this table.


In the first cell below this, repeat the above, substituting the Championship Sheet.

Then repeat for the League 1 and League 2 sheets.


Now your selections table has all the teams in all leagues. From here, select Inspector -> Organize -> Filter


Add a filter that filters the table where column E (HW%) is greater than 0.6:



Done.


The first step copies all the teams into the Selections sheet. The second step filters that table to only show the teams with a ≥60% HW%


The table is also dynamic, so it will automatically update as the source tables update, as opposed to a script which will need to be run manually each time the source data is updated.


Does that do what you want?



Jun 6, 2026 2:35 AM in response to Camelot

thanks Camelot I have attached two photos one of the premier league , the rest of the leagues are set up the same. the second is the selections page the only difference is column 1 has date and 2 league. At present I manually transfer the rows with a greater the 60% in column e on the league sheet to selections and enter date and league.


Jun 7, 2026 5:03 AM in response to Deadalus4

I do have some knowledge of vb in xl but as I said Earlier new to numbers , I have tried and and get a copy of a single line from Premier to selections. I have tried to read for all lines but getting error message "Numbers got an error: Can’t get sheet \"Premier\" of table \"Selections\" of sheet \"Selections\" of document 1." number -1728 from sheet "Premier" of table "Selections" of sheet "Selections" of document 1. I have attached the code and added a new bit if you could help?

tell application "Numbers"


activate



set thresholdText to text returned of (display dialog "Enter percentage threshold:" default answer "60")


set thresholdValue to thresholdText as number



set leagues to {"Premier", "Championship", "League1", "League2"}



tell front document


tell sheet "Selections"


tell table "Selections"




--repeat with  leagues



tell sheet (leagues as text)


tell table "DATA"



set lastRow to row count



repeat with r from 8 to lastRow




set teamName to value of cell 1 of row r



if teamName is not missing value and teamName is not "" then



set pctValue to value of cell 5 of row r



-- handle % formats (0.60 or 60)


if pctValue < 1 then


set pctCompare to pctValue * 100


else


set pctCompare to pctValue


end if



if pctCompare > thresholdValue then



tell table "Selections" of sheet "Selections"



add row below last row


set newRow to row count



-- Date


set value of cell 1 of row newRow to ((current date) as text)



-- League


set value of cell 2 of row newRow to (leagues as text)



-- Copy A:P → C:R


repeat with c from 1 to 16


set value of cell (c + 2) of row newRow ¬


to value of cell c of row r


end repeat



end tell



end if


end if





end repeat



end tell


end tell




end tell


end tell


end tell


end tell

Numbers Mac: Automate filtering and copying by percentage

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