Created attachment 201720 [details] Sample file to test. Under sorting it is written: "However, it also recognizes the first row as a header row and excludes it from the sort." Source: Calc Guide 25.2, Chapter 15 - Calc as a Database https://books.libreoffice.org/en/CG252/CG25215-CalcAsADatabase.html#toc24 To be true, there must be at least one column header that is text and the column content must be numbers. If the content of all cells are just text, or the content mix text and numbers, the first row is sorted too. Header recognition… …works with: a b 1 2 2 1 …works with: a b aaa 2 bbb 1 …don't works with: 1 2 a b b a …don't works with: a 0 aaa 2 bbb 1 …don't works with: a b aaa bb bbb aa Version: 24.8.5.2 (X86_64) / LibreOffice Community Build ID: 480(Build:2) CPU threads: 4; OS: Linux 6.4; UI render: default; VCL: gtk3 Locale: es-MX (en_US.UTF-8); UI: en-US Calc: threaded
Do you mean something like the following? In case the column has a text in the first row and only numbers in the following rows, Sort recognizes the first row as a header row and excludes it from the sort. That the Sort dialog has to be used in other cases, follows in the next but one paragraph.
(In reply to Regina Henschel from comment #1) > Do you mean something like the following? > > In case the column has a text in the first row and only numbers in the > following rows, Sort recognizes the first row as a header row and excludes > it from the sort. Maybe: However, if there is at least one column with text in the first row and numbers in the following rows, Sort recognizes the first row as a header row and excludes it from the sort.
This text is going to the Help first and later to the book. -------8<------ Sorting a block of cells in LibreOffice Calc A block of cells is a rectangular range of cells surrounded by empty cells. LibreOffice Calc automatically identifies a block of cells for sorting. Place the cursor within the block, and the sorting will take place accordingly. If all the cells in the first row of a block are text cells, this row is assumed to be the header. The sorting will then be performed from the second row to the last row of the block, except if all the block cells are text cells. However, if any cell in the first row contains a numerical value, or all the block cells are text cells, the first row will not be considered a header, and sorting will be applied to the entire block. The sorting is applied to the selected column or the first column of the block. If the selected column is inside the block, LibreOffice Calc prompts to extend the sorting to the adjacent columns. -------8<------
Olivier Hallot committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/help/commit/632d38b60f5169e1ab2651d52667f7415c7d3800 tdf#167442 Precision on sorting blocks of cells.