Question

I have an OpenOffice spreadsheet that has several categories (different kinds of meat and vegetables, for example) and for each of them, it lists the spices that go well with it (thyme, garlic, etc).

Is there a way to make a table/spreadsheet, that has the categories as one axis and the spices as the other, and marks the matches with an X or a colored cell?

A bit like this:

I have:

Pork        Garlic Parsley Chive
Beef        Garlic Thyme   Sage
Cauliflower Curry  Thyme
Tomato      Garlic Curry   Sage

I would like to have:

            Garlic Curry Parsley Chive Thyme Sage 
Pork           X            X      X
Beef           X                         X     X
Cauliflower           X                  X      
Tomato         X      X                        X

I really do have a list of spices and food, inspired by this Infographic. I expanded a lot upon it with other sources, and now I want to be able to see my data a bit better.

Was it helpful?

Solution

You can do something like this using the Pivot Table functionality (in LibreOffice Calc: Menu Data -> Pivot Table -> Create...). In Apache OpenOffice Calc, this feature is named Data Pilot. In your use case, you will have to normalize the raw data before you can create a pivot table (AFAIK). So, if your raw data would look like this:

Categories  Spice
Pork    Garlic
Pork    Parsley
Pork    Chive
Beef    Garlic
Beef    Thyme
Beef    Sage
Cauliflower Curry
Cauliflower Thyme
Tomato  Garlic
Tomato  Curry
Tomato  Sage

you can easily create a pivot table looking like this:

Pivot Table

To adapt the layout, just use the conditional formatting tools (this allows for replacing the count 1 by an X and applying background colors). The pivot table definition simply looks as follows:

Pivot table definition

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top