How to group rows together for a sort?

Hi,
I’m trying to make a database for myself with electronic components that I regularly use.
With for example resistors there are many different values the resistors can have, but they can also have different sizes within the same value.
I’d like to be able to sort the table by value, but that it somehow takes the different rows that belong to that value with it.

https://imgur.com/a/ogMO8E3
https://imgur.com/a/ogMO8E3

Can I somehow group rows together? The 3 rows that have the 3 different sizes for 50 ohms would be grouped together, the 2 with the different sizes of the 75 ohm, etc.

Is there a way to do this? Thanks in advance.

(Edit: activated screenshots -AK)

I suggest to not use calc for " to make a database" as you say. Calc isn’t a database.

Hi,

you can use the build-in sort for what you are trying todo

  1. Fill your value colum up with values
  2. Selecting your entire table to sort
  3. Data > Sort …
  4. Define Sort Key 1 → Value Column
  5. Define Sort Key 2 → Which every option you want to sort by

Example Result:

Hope that helps.

Thanks!
That is not exactly what I had hoped for (It makes it look a bit busier than I would have liked) but it works, and thats what matters most I guess :slight_smile:

Maybe there is a better way by using pivot tables.
But i am not an expert with/on those. Sorry.

it look a bit busier

To hide repeated consecutive values after filling column A, use conditional formatting with Formula is:

INDIRECT(CONCAT("A";ROW()))=INDIRECT(CONCAT("A";ROW()-1))

And add a new style with Font color: set to White.

image description

image description

See sample file.

Tested with LibreOffice 7.0.6.2 (x86); OS: Windows 6.1.

More LibreOffice Help on Conditional Formatting.


Add Answer is reserved for solutions. If you think the answer is not satisfactory, add a comment below, or click edit (below your question) to add more information. Thanks.

Check the mark (Answer markCorrect answer mark) to the left of the answer that solves your question (it may take a little while until it turns green).

If the answer helped you, you can mark the up arrow (Upvote mark) that is on the left (to vote, you need to have karma of at least 5).