This spreadsheet imported into LO calc has multiple sort/filter buttons but I can’t work out how to do this in LO. I have a simple spreadsheet that I keep adding rows to that I’d like to be able to easily sort/re-sort a couple of fields (sort companies alphabetically, then re-sort by date so the latest one is at the bottom), but have been unable to find a solution I can’t work out how to apply (auto)filter to a defined range, or to get filters to work for this - it’s really sort order that I need I think but there isn’t a button option for that. Any pointers on how to achieve this would be appreciated. Many thanks
It is →→Data→→Autofilter…
Thanks Karolus, but if I add one autofilter (AF), then move to the other field, the first AF disappears. If I select the two fields, AF is greyed out.
being exactly what cells? Best upload a sample document to reproduce the case.
You can filter on multiple columns for some time, at least since LO 6.1, see Applying AutoFilter
You have two header rows which makes things more difficult. I would be inclined to select from cell A2:[End of Table] and use that as your range for sorting and filtering.
This button is the same as clicking Data > Sort… and brings up a dialogue in which you can sort on three criteria. You don’t show Companies or Date in your screenshot so lets try by Style (Unnamed cell in Column B) then by Approx Seasons Use
You can now select filtering options. Second and subsequent filters will filter only on already filtered data.
This - Company and date - the list is growing now to more than two screens & if I want to see if I’ve written to a company, it’s much easier if the companies are in alphabetic order.
However, I also want to revert to the most recent entry at the bottom. If I was on Windows I’d use Access for this, but haven’t had much luck with the desktop database offerings for Linux and I’m not sufficiently techy to go into full database mode. I’d be interested in a proper desktop database option though…
Contact_2023Test.ods (11.2 KB) Thanks
Thanks, I had tried that guide but even with various attempts at defining data ranges, the autofilter & sort options are greyed out on mine (Version: 6.4.7.2). I also could have made it clearer that the complex spreadhseet screenshot isn’t my spreadsheet but one that shows that LO can do this. I’ve attached my own spreadsheet here. Regards
Contact_2023Test.ods (11.2 KB)
You can’t filter or sort on a multi-range selection, select one contiguous range instead.
Not as “nice” as Access, but LibreOffice/Base connected to sqlite gives features of SQL and I can drag a table or (more important) query to Calc.
In your screenshot you have selected two columns to sort, disregarding the neighbouring data. If you were successful then columns C and F would be sorted but the cells next to them would keep their current order. This would damage your data, lucky you couldn’t do it
In your sample cells A1:J4 form a contiguous range. Click any cell in that range (or in case of empty columns in the range, select the entire range) then click Data > Sort.
In the dialogue that appears:
- for Sort Key 1 you have selected COMPANY, for Sort Key 2 you can now select DATE. The result of that is that Companies will be grouped together and the latest date will be at the bottom of each grouping.
- If Sort Key 1 is DATE and Sort Key 2 is COMPANY then date will be sorted first and only if there is more than one date the same will company be sorted.
- As you already have a filter for company just sorting by DATE then filtering by company might work better.
You sample is too small to see any effect from the second sort key,
Contact_2023TestBigger.ods (17.1 KB)