Calc: insert row when cell content changes and add content of the cell to the line

asked 2019-10-08 13:48:28 +0100

Petr Břeň gravatar image

Hello,

I have a rather complicated task, so far I've been doing it manually but it's becoming very repetitive (over 1500 rows).

I have the following table:

category - product - price
drinks     - beer     - 20
drinks     - wine    -  30
drinks     - tea      -  10
food       - rice      -  25
food       - bread   -  35
food       - fruit    -   15

I need the following result:

product       - price
drinks
beer           -  20
wine           -  30
tea            -  10
food
rice           -  25
bread          -  35
fruit          -  15

I.e. when the category changes, an empty row is added above, the name of the category is copied to the new row to the product cell and when it's done, the category column is deleted.

A friend of mine told me he used to be able to do this using formulas, I'm not sure about that and I think a macro needs to be written for that. What do you think?

Thank you very much

Petr Břeň

edit retag flag offensive close merge delete

Comments

Also asked at the OpenOffice forum

robleyd gravatar imagerobleyd ( 2019-10-11 11:45:47 +0100 )edit