In Numbers? Creating automated sheets?

I have a database with 800 names, the amount of money the company pays each person, their bonus, the amount the insurances cost, ect....Trying to produce a custom benefit statement for each employee. Its one big well organized spreadsheet with the raw data and a couple of columns I added for totals and charting info.


I then designed a beautiful page with text, charts and data fields from this data for distribution to each person. The problem is, I did it for 3 people....and putting the formula into each persons statement is time consuing....I did 3 of of the...is there a way to automate this....its the same exact processs for all 797 that I have left...


So row 1 in the master spreasheet has person 1's info for their benefit statement....row 2 has person 2's info for their benefiit statement Again, the benefit statements are identical except for the data that goes into them...which comes from the master spreadsheet...any ideas?


Thanks-

Posted on Apr 20, 2013 5:01 PM

Reply
11 replies

Apr 20, 2013 7:11 PM in response to Stefan Boyland

If you have a field some place where you can enter the employee number and the report is filled out based on that field then you could auomate with an Apple script that performed the repeated series of operations:

1) set the employee number

2) print the report to PDF

3) go back to (1) so long as there is another employee


Can you post an small representative example?

Apr 21, 2013 12:11 AM in response to Stefan Boyland

Hi Stefan,


Here's an alternate method using MATCH and OFFSET.


I've done two examples, one assuming a vertical arrangement of the data on the individual reports, the other assuming a horizontal arrangement. Each small table requires entry of only the person's name (exactly as listed on the Main table); the rest is filled automatically.

User uploaded file

The larger table contains entered data and no formulas. Jill's table contains the formula below, entered in A2, and filled down.


A2: =OFFSET(Main :: $A$1,MATCH($A$1,Main :: $A,0)-1,ROW()-1)


Joe's table contains the similar formula below, entered in B2 and filled right:


B2: =OFFSET(Main :: $A$1,MATCH($A$2,Main :: $A,0)-1,COLUMN()-1)


Jill's table was selected, then duplicated (command-D) and moved down the page. Jill's name was replaced with John.


Joe's table was selected, then duplicated (command-D) and moved down the page. Joe's name was replaced with Jane.


Regards,

Barry

Apr 21, 2013 8:02 AM in response to Stefan Boyland

Ok, I see some answers, but not sure if these answers will automate this wohle process. I have 800 names in a database with all employer costs for that employee...first name, last name, compensation, gov't tax, health insurance, pension, disability insurance, ect....horizontally across...lets call that my MASTER DATABASE...I want each employee (which is 1 row in the database) to get a 1 page statement (let's call it BENEFIT STATEMENT) of what their FULL pay really is with benefits...I made a beautiful layout pay...with graphs, charts, text, ect., where I pull some of that info from the master database into a nice 1 page report. I can save this as a PDF.


Now I made that page. It looks great...but entering the formulas manually in that first persons template took me a few minutes. I have 10 spots (tables) that have 1 individual piece of info in that spot on their BENEFIT STATEMENT...and that is my 2nd sheet in Numbers...now if I do the 2nd peson, I need to create a new sheet...copy my template into that sheet and then manually put the formulas into the 10 tables I have on that sheet.


How do I automate this?


What I want as an output...is 800 SHEETS in NUMBERS with each new sheet created, being created with the persons first and last name.....when done, my Numbers document should have the Master Database on the first sheet...perhaps my template on the 2nd sheet....and then Sheets 3-802 should have a persons full name labelled with their completed benefit statement. Then I can save sheets 3-802 as a single PDF...print it out and distribute.


Or perhaps figure out way to mass email it through Filemaker which I also use. Thanks all.

Apr 21, 2013 1:14 PM in response to Barry

Barry,


That was part of the "I'm not sure how hard" since I don't use charts. Unless the data table is different from a regular Pages table, though, I'm not sure it is a problem, because I just created a new Pages document with a table and chose a Numbers file to merge from and I could put merge fields in the cells and the merge worked. You have to double click in the cell to get the text cursor, then the menu option to insert a merge field becomes active.


Jeff

Apr 21, 2013 1:23 PM in response to Stefan Boyland

HI STEFAN!


No need to shout.


What you've called "Master Database". I've named "Main"; what you've called "Benefits Package", I've referred to as the "smaller tables." These smaller tables represent only the 'working' parts of the Benefits Package pages—the parts that transfer data from one row of Main to cells in one or more tables on the BP sheet.


You have already designed your BP page and placed single or multiple cell tables on it to receive your data. There's no need to re-do that design process. To implement the method of filling the cells described in my earlier post, all that's needed is to enter the formulas presented, using fixed numbers rather than COLUMN()-1 to specify the column offset, into each cell in one copy of the BP sheet.


As written above, the process requires entering the name of each person. By adding a column to Main and filling that column with a 'serial number' using the formula =ROW()-1, you can fill each BP's cells by entering one of these numbers into a cell added for that purpose. Set the cells borders, fill and text colour all to white (or to match the background colour in the place where that cell is located, and it will be invisible in the print out.


Revised formula below assumes you have added the index/serial column as the new column A on the Master Database table (Named "Main" in the formula, that Main is the only table with that name in the document , and that the single cell table on a BP sheet to contain the number for the person whose data is to be used on that sheet in named "No."


Here's the sample, with person 3 selected in No. Each piece of transferred data is in a separate single cell table with the cell borders set to "none". Position on each is arbitrary (and changeable).

User uploaded file

With one BP sheet set up, you'll need to duplicate the sheet as many times as you think necessary, then replace the number in No. with either a fixed number, or a formula which calculates the number from the No. table on the previous sheet. (see below)


=OFFSET(Main :: $A$1,MATCH(No.::$A$1,Main :: $A,0)-1,1) returns value from column B of Main (John)

=OFFSET(Main :: $A$1,MATCH(No.::$A$1,Main :: $A,0)-1,2) returns value from column C of Main (Black)

=OFFSET(Main :: $A$1,MATCH(No.::$A$1,Main :: $A,0)-1,3) returns value from column D of Main (benefit 1)

=OFFSET(Main :: $A$1,MATCH(No.::$A$1,Main :: $A,0)-1,4) returns value from column E of Main (benefit 2)

=OFFSET(Main :: $A$1,MATCH(No.::$A$1,Main :: $A,0)-1,5) returns value from column F of Main (benefit 3)

etcetera for as many tables as there are data columns to transfer.


Duplicate the sheet, and on the new sheet, enter a new number in the No. table.


Unfortunately, when duplicating a sheet, Numbers appends "-1" to the end of the sheet name, rather than incrementing the number from Sheet 2 to Sheet 3. Without stopping to rename each new sheet, this soon becomes unwieldy. With stopping and renumbering each sheet, it soon becomes tedious, especially if editing the formula placed in No. to increment the person number for each sheet/page.


If entering the number directly into each table, you'll need to do all 800 sheets. If using a formula, you can do a subset (say 100, or even 50, then replace one number (in the first BP sheet) before printing the batch to PDF.



Formula for the first calculated person number (2, on Sheet 3)


A1: =Sheet 2::No.::A1+1


On subsequent sheets, doubleclick the cell reference lozenge to make it editable and increment the Sheet number by 1.


When printing,

Enter 1 in No. on Sheet 2, then print pages 2 - 51 to print (to PDF) the first fifty BDs

Enter 51 in No. on Sheet 2, then print pages 2 - 51 to print the next 50.

Etc.


It may be possible to set up all 800 new sheets (all with 1 in the No. table), then use an AppleScript to replace the 1s with serial numbers from 1 to 800. Numbers will likely be pretty slow in responding, which may result in timing issues with the script. You may also find that 800 is beyond the limit of sheets in a single document.


Regards,

Barry


Regards,

Barry

Apr 21, 2013 1:40 PM in response to Jeff Shenk

Jeff,


Charts can be copied from Numbers and placed in Pages, where they remain linked to the data in the Numbers table. Unfortunately, "linked to the data" means linked to the data in specific cells, so the iterations of that chart would likely show the same data, not the data for each merged record.


Charts that are created in Pages are fed by the table in a "Data Editor" attached to the chart. AFAIK, they can't draw data from a 'regular' table inserted in the Pages document (the type that it's possible to place a merge field in).


Regards,

Barry

Apr 22, 2013 9:40 AM in response to Stefan Boyland

Stefan Boyland wrote:


Jerry, do you write a script to do this...more info? How do you accomplish this? Write a report...what report? What do you mean? And then "grab the data from that report"...are you talking about using Apple Script or Automator? Or can you do this in Numbers alone?

Stefan,


I interpreted "automate" as meaning to having to laborously create 800 report pages, but rather looking for a way to make one report and have it serve for all. I didn't foresee your wanting to push a button and have all 800 reports print off at once. Not that this would be a bad idea, but your request wasn't clear to me.


Jerry

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.

In Numbers? Creating automated sheets?

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