Discussion:
Conditional hide rows in Calc?
Wayne Stidolph
2011-07-18 00:35:12 UTC
Permalink
I have a variable numbers of data elements for each day, and I'd like to
hide all but the last of each day (or export only the last-of-day values);
is there an easy way?

Example data:
row | date | reading number | value | ...
1 | 7/1/2011 | 1 | 3
2 | 7/2/2011 | 1 | 6
3 | 7/2/2011 | 2 | 7
4 | 7/2/2011 | 3 | 5
5 | 7/4/2011 | 1 | 4
6 | 7/5/2011 | 1 | 5
7 | 7/5/2011 | 2 | 6

So I'd like to extract:
1 | 7/1/2011 | 1 | 3


4 | 7/2/2011 | 3 | 5
5 | 7/4/2011 | 1 | 4

7 | 7/5/2011 | 2 | 6

Is there a way to use conditional formatting to hide a row, based on a test
of the reading number of the current row compared to the reading number of
the next row?
--
Wayne

--
Unsubscribe instructions: E-mail to users+***@global.libreoffice.org
In case of problems unsubscribing, write to ***@documentfoundation.org
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Simon Cropper (The foss Workflow Guides)
2011-07-18 00:57:12 UTC
Permalink
On 18/07/11 10:35, Wayne Stidolph wrote:
> I have a variable numbers of data elements for each day, and I'd like to
> hide all but the last of each day (or export only the last-of-day values);
> is there an easy way?
>
> Example data:
> row | date | reading number | value | ...
> 1 | 7/1/2011 | 1 | 3
> 2 | 7/2/2011 | 1 | 6
> 3 | 7/2/2011 | 2 | 7
> 4 | 7/2/2011 | 3 | 5
> 5 | 7/4/2011 | 1 | 4
> 6 | 7/5/2011 | 1 | 5
> 7 | 7/5/2011 | 2 | 6
>
> So I'd like to extract:
> 1 | 7/1/2011 | 1 | 3
>
>
> 4 | 7/2/2011 | 3 | 5
> 5 | 7/4/2011 | 1 | 4
>
> 7 | 7/5/2011 | 2 | 6
>
> Is there a way to use conditional formatting to hide a row, based on a test
> of the reading number of the current row compared to the reading number of
> the next row?

Hi Wayne,

Conditional formatting just changes the look. Not sure it can be used to
hide data.

Create an extra column after reading row. Put formula that compares next
rows reading number with current rows reading number, insert a value -
e.g. 'END', to represent end of day - then use autofilter to hide the
data you don't want to see.

The formula would look something like this...

=IF(CurrentRowReadingNumber > NextRowReadingNumber, "END", "")

--
Cheers Simon

Simon Cropper
Website Administrator
http://www.fossworkflowguides.com
The fossWorkflow Guides
(c) Simon Cropper CC-BY-SA 3.0 Australia
http://creativecommons.org/licenses/by-sa/3.0/au/deed.en

--
Unsubscribe instructions: E-mail to users+***@global.libreoffice.org
In case of problems unsubscribing, write to ***@documentfoundation.org
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Brian Barker
2011-07-18 01:04:27 UTC
Permalink
At 17:35 17/07/2011 -0700, Wayne Stidolph wrote:
>I have a variable numbers of data elements for each day, and I'd
>like to hide all but the last of each day (or export only the
>last-of-day values); is there an easy way?
>
>Example data:
>row | date | reading number | value | ...
>1 | 7/1/2011 | 1 | 3
>2 | 7/2/2011 | 1 | 6
>3 | 7/2/2011 | 2 | 7
>4 | 7/2/2011 | 3 | 5
>5 | 7/4/2011 | 1 | 4
>6 | 7/5/2011 | 1 | 5
>7 | 7/5/2011 | 2 | 6
>
>So I'd like to extract:
>1 | 7/1/2011 | 1 | 3
>
>
>4 | 7/2/2011 | 3 | 5
>5 | 7/4/2011 | 1 | 4
>
>7 | 7/5/2011 | 2 | 6
>
>Is there a way to use conditional formatting to hide a row, based on
>a test of the reading number of the current row compared to the
>reading number of the next row?

Yes. Your dates are in column A, starting in row 1. In row 1 of a
new column, put the formula
=A1<>A2
Now fill this down the new column. The last rows of each day - which
you want to keep - are now marked TRUE and the others FALSE. Select
the new column and go to Data | Filter > | Standard Filter...
. Ensure that "Field name" refers to your new column, and choose "="
for Condition and TRUE (or 1) for Value.

To export the required values, just copy the filtered region and
paste it somewhere else: only the visible cells will be copied.

Note that you can hide the new column if preferred.

I trust this helps.

Brian Barker
Wayne Stidolph
2011-07-18 01:25:20 UTC
Permalink
Thanks, Simon, Brian - I'm an infrequent spreadsheet-user and just didn't
think about filters. These approaches work fine! -- Wayne

On Sun, Jul 17, 2011 at 6:04 PM, Brian Barker <***@btinternet.com>wrote:

> At 17:35 17/07/2011 -0700, Wayne Stidolph wrote:
>
>> I have a variable numbers of data elements for each day, and I'd like to
>> hide all but the last of each day (or export only the last-of-day values);
>> is there an easy way?
>>
>> Example data:
>> row | date | reading number | value | ...
>> 1 | 7/1/2011 | 1 | 3
>> 2 | 7/2/2011 | 1 | 6
>> 3 | 7/2/2011 | 2 | 7
>> 4 | 7/2/2011 | 3 | 5
>> 5 | 7/4/2011 | 1 | 4
>> 6 | 7/5/2011 | 1 | 5
>> 7 | 7/5/2011 | 2 | 6
>>
>> So I'd like to extract:
>> 1 | 7/1/2011 | 1 | 3
>>
>>
>> 4 | 7/2/2011 | 3 | 5
>> 5 | 7/4/2011 | 1 | 4
>>
>> 7 | 7/5/2011 | 2 | 6
>>
>> Is there a way to use conditional formatting to hide a row, based on a
>> test of the reading number of the current row compared to the reading number
>> of the next row?
>>
>
> Yes. Your dates are in column A, starting in row 1. In row 1 of a new
> column, put the formula
> =A1<>A2
> Now fill this down the new column. The last rows of each day - which you
> want to keep - are now marked TRUE and the others FALSE. Select the new
> column and go to Data | Filter > | Standard Filter... . Ensure that "Field
> name" refers to your new column, and choose "=" for Condition and TRUE (or
> 1) for Value.
>
> To export the required values, just copy the filtered region and paste it
> somewhere else: only the visible cells will be copied.
>
> Note that you can hide the new column if preferred.
>
> I trust this helps.
>
> Brian Barker
>
>
>
> --
> Unsubscribe instructions: E-mail to users+***@global.libreoffice.**org<users%***@global.libreoffice.org>
> In case of problems unsubscribing, write to ***@documentfoundation.
> **org <***@documentfoundation.org>
> Posting guidelines + more: http://wiki.**documentfoundation.org/**
> Netiquette <http://wiki.documentfoundation.org/Netiquette>
> List archive: http://listarchives.**libreoffice.org/global/users/<http://listarchives.libreoffice.org/global/users/>
> All messages sent to this list will be publicly archived and cannot be
> deleted
>
>


--
Wayne

--
Unsubscribe instructions: E-mail to users+***@global.libreoffice.org
In case of problems unsubscribing, write to ***@documentfoundation.org
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Loading...