Only print rows whose first cell contains "1"

Hello,
Newbie question: In “LibreOffice Calc”, is it possible to only print rows whose first cell contains “1”?
(I’ve searched using variations of “LibreOffice Calc print conditionals” and failed.)

Below is a mockup of the “SPREAD SHEET” and its desired “PRINTED OUTPUT”.
Placing “1” in the first cell of a row causes the row to print.
Placing anything other that “1” in the first cell of a row causes the row NOT to print.
(Also, I have NOT printed the 1st column. Please ignore the deleted column for this question.)

My goal is to make a large list of items, then select small subsets to be summed and printed.
I use “Print” as a multiple (“1” to include, and “0” to exclude) to determine which items are summed and printed out, and which items are excluded and not printed out.

  • SPREAD SHEET:
Print   Description     Data-1          Data-2          Data-3          Data-4
1       HEADING-1 
0       item-1          111x1           111x2           111x3           111x4
1       item-2          222x1           222x2           222x3           222x4
0       item-3          333x1           333x2           333x3           333x4
1
1       HEADING-2 
1       item-4          444x1           444x2           444x3           444x4
1       item-5          555x1           555x2           555x3           555x4
0       item-6          666x1           666x2           666x3           666x4
1
1       HEADING-3 
1       item-7          777x1           777x2           777x3           777x4
1       item-8          888x1           888x2           888x3           888x4
1       item-9          999x1           999x2           999x3           999x4
1
1       HEADING-4 
0       item-10         1010x1          1010x2          1010x3          1010x4
1       item-11         1111x1          1111x2          1111x3          1111x4
1
1       TOTALS:         aaaax1          bbbbx2          ccccx3          ddddx4
  • PRINTED OUTPUT:
Description     Data-1          Data-2          Data-3          Data-4
HEADING-1 
item-2          222x1           222x2           222x3           222x4

HEADING-2 
item-4          444x1           444x2           444x3           444x4
item-5          555x1           555x2           555x3           555x4

HEADING-3 
item-7          777x1           777x2           777x3           777x4
item-8          888x1           888x2           888x3           888x4
item-9          999x1           999x2           999x3           999x4

HEADING-4 
item-11         1111x1          1111x2          1111x3          1111x4

TOTALS:         aaaax1          bbbbx2          ccccx3          ddddx4

Any help appreciated.

Try AutoFilter.

2 Likes

Hello LeroyG,
I was able to use AutoFilter to solve my problem
Thank you for the pointer.

It’s also possible to use conditional formatting applying a style with Hide when printing set for rows where first column is not 1.

1 Like

That one is a great option, but will leave blank rows.
imagen

1 Like

Hello mikekaganski,
I tried a variation of your suggestion.
Unfortunately, it prints a BLANK row instead for removing the row.

Below is my test case.
(I used the condition “Formula is” because it can always reference the 1st cell.
I was not able to get the condition “Cell value” to reference the 1st cell in all cases.
So this test below was just to test printing, nothing else.)

EXAMPLE for row “9”:

  <Select row "9">
  Format - Conditional - Condition...
    Formula is    $A9    <- reference absolute 1st column cell (if $A9 is not "0", then condition is "true")
    Apply Style: New Style
      Organizer tab
        Name: Hide when printing
      Cell Protection tab
        [CHECK] Hide when printing    The cells selected will be omitted when printing.
      OK
    ADD
  OK

If cell A9 = 0, then the contents of all the cells in row “9” are printed.
If cell A9 != 0, then row “9” is printed as a BLANK row.

It’s a partial solution.

Thank you for your suggestion.

EDIT (hint of @LeroyG)

  1. Sort column 1 (Print → descending)
  2. Select print area
  3. Print selected area
  4. Undo sort


.
Cheers

EDIT
Also possible: menu DATA → More Filters → Standard Filter → Print = 1 (then select print area or hide column A - hidden column does not print)

1 Like

After printing, don’t forget to undo.

1 Like

Hello Grantler,
Thank you for the instructions.
I learned several things while studying it.