M: In libre office, can I make a list inside a single cell, and then do a filter which selects any of the elements in that list?
G: Yes, you can achieve this in LibreOffice Calc by carefully structuring your data and using helper columns. Here’s how:
A1), enter multiple items separated by
a delimiter (e.g., apple, banana, cherry).B1), use a formula to
check if the cell contains a specific item. For example:
=IF(ISNUMBER(SEARCH("apple", A1)), "apple", "")
Repeat for other items you're filtering on (e.g., "banana" or "cherry")
in additional columns if needed.If you use a delimiter like a comma or space:
=IF(SEARCH("apple", A1), "Yes", "No")M: How would I extract the second entry in a cell list delimited by commas
G: To extract the second entry in a
comma-delimited list within a cell in LibreOffice Calc, you can use the
MID, FIND, and LEN functions.
Here’s the step-by-step formula:
Assume the cell with the comma-separated list is A1, and
the list is something like apple, banana, cherry.
=TRIM(MID(A1, FIND(",", A1) + 1, FIND(",", A1, FIND(",", A1) + 1) - FIND(",", A1) - 1))
FIND(",", A1): Finds the position of the first
comma.FIND(",", A1, FIND(",", A1) + 1): Finds the position of
the second comma.MID(A1, FIND(",", A1) + 1, FIND(",", A1, FIND(",", A1) + 1) - FIND(",", A1) - 1):
Extracts the text between the first and second commas.TRIM(...): Removes any extra spaces around the
extracted text.To avoid errors if there’s no second comma, you can add a fallback
using IFERROR:
=IFERROR(TRIM(MID(A1, FIND(",", A1) + 1, FIND(",", A1, FIND(",", A1) + 1) - FIND(",", A1) - 1)), "")
This will return an empty string if the second entry doesn’t exist.
Let me know if you need help adapting this!
M: Formula to multiply by cell b3 if it contains a value, or 1 if it is blank
G: Here’s the formula to achieve this in LibreOffice Calc:
=A1 * IF(ISBLANK(B3), 1, B3)
ISBLANK(B3): Checks if B3 is blank.IF(ISBLANK(B3), 1, B3): Returns 1 if
B3 is blank; otherwise, it returns the value in
B3.A1 * ...: Multiplies the value in A1 by
the result of the IF statement.If you want to treat a blank cell or a cell with zero as
1, you can use:
=A1 * IF(B3=0, 1, B3)
This ensures the formula works even if B3 has a value of
0.
M: Assume a table of numbers with a label column and a label row. Can I apply a filter based on the row label, which returns any column header whose value is less than a arbitrary designated value?
G: LibreOffice Calc does not directly support filtering based on both row labels and column headers in a cross-table format. However, you can achieve this using helper rows or formulas to extract the column headers that meet your criteria.
Assume the following table (starting from A1):
| A | B | C | D | |
|---|---|---|---|---|
| Row1 | 5 | 10 | 15 | 20 |
| Row2 | 3 | 8 | 12 | 25 |
| Row3 | 7 | 2 | 9 | 14 |
For example, filter by Row2 where values are less than
10 and return the column headers (B,
C, etc.).
Add a Helper Row Use a helper row to check which
values in the specified row (Row2) meet the condition.
Place the helper row below the table.
In cell A5 (below the column headers):
=IF(B2<10, B$1, "")
B2 is the value in the target row
(Row2).B$1 is the column header.B,
C, etc.) if the condition is met; otherwise, it leaves the
cell blank.Drag the Formula Across Drag the formula across
the row (A5:D5) to check all columns for
Row2.
The helper row will now display the matching column headers where the condition is met.
Filter or Extract the Results
=TEXTJOIN(", ", TRUE, A5:D5)
This will combine the matching column headers into a comma-separated
list.For Row2 with the condition <10, the
helper row will show: | | A | B | C | D |
|------|------|------|------|------| | | B | C | | |
And TEXTJOIN will return B, C.
Let me know if you'd like a more specific walkthrough!