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:

1. Create a List in a Single Cell

2. Set Up a Helper Column to Enable Filtering

3. Apply the Filter

Alternative: Advanced Filtering with Regular Expressions

If you use a delimiter like a comma or space:

  1. Enable regular expressions in Calc (Tools > Options > LibreOffice Calc > Calculate > Enable regular expressions in formulas).
  2. Use a formula like:
    =IF(SEARCH("apple", A1), "Yes", "No")
  3. Filter on cells that show "Yes."

Limitations

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:

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))

Explanation

  1. FIND(",", A1): Finds the position of the first comma.
  2. FIND(",", A1, FIND(",", A1) + 1): Finds the position of the second comma.
  3. MID(A1, FIND(",", A1) + 1, FIND(",", A1, FIND(",", A1) + 1) - FIND(",", A1) - 1): Extracts the text between the first and second commas.
  4. TRIM(...): Removes any extra spaces around the extracted text.

If There’s No Second Comma

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)

Explanation:

  1. ISBLANK(B3): Checks if B3 is blank.
  2. IF(ISBLANK(B3), 1, B3): Returns 1 if B3 is blank; otherwise, it returns the value in B3.
  3. 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.

Example Table

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

Goal

For example, filter by Row2 where values are less than 10 and return the column headers (B, C, etc.).


Steps to Apply the Filter:

  1. 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.
    • The formula returns the column header (B, C, etc.) if the condition is met; otherwise, it leaves the cell blank.
  2. 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.

  3. Filter or Extract the Results

    • You can manually read the helper row or use an array formula to consolidate the results into a single cell.
    • For example, to list all matching column headers in one cell:
      =TEXTJOIN(", ", TRUE, A5:D5)
      This will combine the matching column headers into a comma-separated list.

Result

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!