2

I have a Numbers spreadsheet consisting of data that I would like to print.

However, I would like to have each row of the table printed out on its own separate page. Moreover, each row contains a lot of data items, including one that is a few paragraphs of text - it doesn't make sense to print it in a single row. Instead I want to print out each row as a separately formatted table.

So for example, if the first row of my table looked like this

enter image description here

then I would like to print it something more like this:

enter image description here

including using conditional formatting to colour the cells, if at all possible.

Is there any way to do this. I.e. to create a new table from each row of a table, and then print them all out, one per page. My table has about 100 rows, so doing each one by hand isn't really feasible.

If this can't be done in Numbers, is there another easy way to do it on a Mac?

3
  • 1
    I hope to have time to provide and answer soon. I have an idea but it requires another sheet and some formulas. I use a similar approach for printing expense sheets from a common table. See this answer for an idea.
    – bjbk
    May 20, 2018 at 3:51
  • @bjbk that would be great - I did come up with a solution in the end, but it was a terrible hack involving using AppleScript to create ~100 new sheets. It worked but isn't robust at all, so I'd be very happy to see a better solution. (I intend to post my own as a self-answer at some point.)
    – N. Virgo
    May 20, 2018 at 4:32
  • See my answer below. If I can add any further clarification let me know! Cheers
    – bjbk
    May 23, 2018 at 3:30

1 Answer 1

3

One way to accomplish this just using Numbers

The key to this solution is the combination of the INDEX(MATCH()) formulas. Here is an excellent article on the use of this combination of functions.

Create 2 sheets

  • one sheet for data
  • one sheet for printing

In the Data sheet, add a basic table to hold the data. A header row is useful for reading the formulas as they are added:

data table


In the Print sheet, create a table or tables (one can get creative here, any number of tables or cells to format the printing in any way wished) for a print format. The cells do not need to be in the same table together as each contains an individual reference to the data table. The example in the screenshot below uses two tables.

print table


Back on the Data sheet, create table with one or two cells for selecting the record to print:

index table


Now, back in the Print sheet, use the following formulas to display the desired data:

INDEX(Animal,MATCH(Print Index::B1,Index)) Where Animal is the column containing the animal name, MATCH looks at the single data selector cell matching the corresponding number in the Index column and then returns the Animal.

INDEX(Legs,MATCH(Print Index::$B$1,$Index)) Returns the Legs data.

INDEX(Head,MATCH(Print Index::$B$1,$Index)) Returns the Head data.

INDEX(Feathers,MATCH(Print Index::$B$1,$Index)) Returns the Feathers data.

INDEX(Size,MATCH(Print Index::$B$1,$Index)) Returns the Size data.

Even when other data is inserted into the table, the proper value is displayed. This is unlike VLOOKUP() which has to have the column number returned. When a new column is inserted, VLOOKUP breaks where INDEX(MATCH()) does not.

formula sample


Add the conditional formatting as desired to the cells in the Print sheet's table(s).

Back in the Data sheet, select the number corresponding to the animal desired to print.

Select the Print sheet then print as normally. command+P

AppleScript could be used to automate the process of selecting the index number, then printing the Print sheet.

This is a clean and easy way to maintain/update/change the print view without having to reinvent the entire data schema.


Demo:

Demonstration of the sheet at work

3
  • Thank you for this, it's super helpful. My own method was quite similar, but less elegant in some ways. I used AppleScript to make copies of the report sheet (each with its own index number) rather than print them, which made it easier to correct mistakes before sending to the printer. I'll accept this after I post my own answer (which will include the AppleScript).
    – N. Virgo
    May 23, 2018 at 4:45
  • Glad it’s useful! As they say, there’s more than one way to skin a...
    – bjbk
    May 23, 2018 at 11:33
  • @bjbk a... cat. Or as I say as a long time Unix user 'a cat' (not exactly how I wanted it to appear but close enough). But yes when it comes to programming and also scripting there are so many ways very often. And by seeing one with experience and a different mind/eyes you can come up with something original and it's a great learning experience. Incidentally the amount of thought and effort including screen shots for this answer is wonderful. That's how answers should be when someone is truly wanting to learn.
    – Pryftan
    Aug 2, 2019 at 15:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .