Wednesday, 29 October 2014

One-To-Many Relationship in a Google Spreadsheet

It's often the case that you want and need to be creating a database to store your data, but Google Spreadsheets are just so handy aren't they? But Google Spreadsheets are very good at relational data.

Here's an example where, you want to have one column for the name of your recipe and another for the ingredients ( comma separated ).

How you use this script is you click on the cell you want to be relational and choose the Admin > Show Relationship Editor. This opens up a dialog window showing you all the options included so far. You then alter the ingredients and it saves a comma separated list into the spreadsheet.

Here's the spreadsheet. Use File > Make a copy to see it work and rummage around in the code.

If anyone can help make the UI prettier I'd be grateful, thanks.


  1. Google Docs are a good collaborative tool that is available or probably the best among the word-processing category as Creately is top among the diagram category.

  2. Nice!
    But where is the comma seperated file stored?
    In other words, where can I add new ingredients to the list?

    1. Sorry, found it already, just in the cell. This is very useful for me, thanks!
      Would be nice when the popup shows with a right-click.

  3. This comment has been removed by the author.

  4. The quantitative statistical analysis is best for thee students who have large data and related projects. The analysis report must be unique.