<?xml version="1.0" encoding="UTF-8"?>



<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 -->


		<helpdocument version="1.0">
<meta>
<topic id="textscalcguidespecialfilterxml" indexer="include" status="PUBLISH">
<title xml-lang="en-US" id="tit">Filter: Applying Advanced Filters</title>
<filename>/text/scalc/guide/specialfilter.xhp</filename>
</topic>
</meta>
<body>
  
  
  
<bookmark xml-lang="en-US" branch="index" id="bm_id3148798"><bookmark_value>filters;defining advanced filters </bookmark_value>
<bookmark_value>advanced filters</bookmark_value>
<bookmark_value>defining; advanced filters</bookmark_value>
<bookmark_value>database ranges; advanced filters</bookmark_value>
</bookmark>
  <comment>MW made "applying;advanced filters" a one level entry</comment>
  <paragraph xml-lang="en-US" id="hd_id3148798" role="heading" level="1"><variable id="specialfilter"><link href="text/scalc/guide/specialfilter.xhp" name="Filter: Applying Advanced Filters">Filter: Applying Advanced Filters</link> 
</variable></paragraph>
  <list type="ordered">
   <listitem>
    <paragraph xml-lang="en-US" id="par_id3145785" role="listitem">Copy the column headers of the sheet ranges to be filtered into an empty area of the sheet, and then enter the criteria for the filter in a row beneath the headers. Horizontally arranged data in a row will always be logically connected with AND, and vertically arranged data in a column will always be logically connected with OR.</paragraph>
   </listitem>
   <listitem>
    <paragraph xml-lang="en-US" id="par_id3153142" role="listitem">Once you have created a filter matrix, select the sheet ranges to be filtered. Open the <emph>Advanced Filter</emph> dialog by choosing <emph>Data - Filter - Advanced Filter</emph>, and define the filter conditions.</paragraph>
   </listitem>
   <listitem>
    <paragraph xml-lang="en-US" id="par_id3153726" role="listitem">Then click OK, and you will see that only the rows from the original sheet whose contents have met the search criteria are still visible. All other rows are temporarily hidden and can be made to reappear with the <emph>Format - Row - Show </emph>command.</paragraph>
   </listitem>
  </list>
  <paragraph xml-lang="en-US" id="par_id3149664" role="paragraph"> <emph>Example</emph> </paragraph>
  <paragraph xml-lang="en-US" id="par_id3147427" role="paragraph">Load a spreadsheet with a large number of records. We are using a fictional <emph>Turnover</emph> document, but you can just as easily use any other document. The document has the following layout:</paragraph>
  <table id="tbl_id3149377">
   
   
   <tablerow>
    <tablecell>
     
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3154510" role="paragraph"> <emph>A</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3150327" role="paragraph"> <emph>B</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3154756" role="paragraph"> <emph>C</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3155335" role="paragraph"> <emph>D</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3146315" role="paragraph"> <emph>E</emph> </paragraph>
    </tablecell>
   </tablerow>
   <tablerow>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3145790" role="paragraph"> <emph>1</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3159239" role="paragraph">Month</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3150086" role="paragraph">Standard</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3150202" role="paragraph">Business</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3150883" role="paragraph">Luxury</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3152987" role="paragraph">Suite</paragraph>
    </tablecell>
   </tablerow>
   <tablerow>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3154486" role="paragraph"> <emph>2</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3148839" role="paragraph">January</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3153816" role="paragraph">125600</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3157978" role="paragraph">200500</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3155268" role="paragraph">240000</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3153286" role="paragraph">170000</paragraph>
    </tablecell>
   </tablerow>
   <tablerow>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3146782" role="paragraph"> <emph>3</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3149900" role="paragraph">February</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3154763" role="paragraph">160000</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3150050" role="paragraph">180300</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3153801" role="paragraph">362000</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3154708" role="paragraph">220000</paragraph>
    </tablecell>
   </tablerow>
   <tablerow>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3151191" role="paragraph"> <emph>4</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3147250" role="paragraph">March</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3153334" role="paragraph">170000</paragraph>
    </tablecell>
    <tablecell>
     
    </tablecell>
    <tablecell>
     
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3151391" role="paragraph">and so on...</paragraph>
    </tablecell>
   </tablerow>
  </table>
  <paragraph xml-lang="en-US" id="par_id3147300" role="paragraph">Copy row 1 with the row headers (field names), to row 20, for example. Enter the filter conditions linked with OR in rows 21, 22, and so on.</paragraph>
  <table id="tbl_id3166462">
   
   
   <tablerow>
    <tablecell>
     
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3159115" role="paragraph"> <emph>A</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3146886" role="paragraph"> <emph>B</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3153124" role="paragraph"> <emph>C</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3152979" role="paragraph"> <emph>D</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3145827" role="paragraph"> <emph>E</emph> </paragraph>
    </tablecell>
   </tablerow>
   <tablerow>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3149892" role="paragraph"> <emph>20</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3150693" role="paragraph">Month</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3147475" role="paragraph">Standard</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3154846" role="paragraph">Business</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3153082" role="paragraph">Luxury</paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3149506" role="paragraph">Suite</paragraph>
    </tablecell>
   </tablerow>
   <tablerow>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3149188" role="paragraph"> <emph>21</emph> </paragraph>
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3149956" role="paragraph">January</paragraph>
    </tablecell>
    <tablecell>
     
    </tablecell>
    <tablecell>
     
    </tablecell>
    <tablecell>
     
    </tablecell>
    <tablecell>
     
    </tablecell>
   </tablerow>
   <tablerow>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3150865" role="paragraph"> <emph>22</emph> </paragraph>
    </tablecell>
    <tablecell>
     
    </tablecell>
    <tablecell>
     <paragraph xml-lang="en-US" id="par_id3155957" role="paragraph">&lt;160000</paragraph>
    </tablecell>
    <tablecell>
     
    </tablecell>
    <tablecell>
     
    </tablecell>
    <tablecell>
     
    </tablecell>
   </tablerow>
  </table>
  <paragraph xml-lang="en-US" id="par_id3153566" role="paragraph">Specify that only rows which either have the value <item type="literal">January</item> in the <emph>Month</emph> cells OR a value of under 160000 in the <emph>Standard</emph><comment>standard not default, look at U59!!!</comment> cells will be displayed.</paragraph>
  <paragraph xml-lang="en-US" id="par_id3147372" role="paragraph">Choose <emph>Data - Filter - Advanced Filter</emph>, and then select the range A20:E22. After you click OK, only the filtered rows will be displayed. The other rows will be hidden from view.</paragraph>
  <section id="relatedtopics">
   
   <embed href="text/scalc/guide/filters.xhp#filters"/>
   <embed href="text/scalc/guide/autofilter.xhp#autofilter"/>
   <embed href="text/scalc/guide/cellcopy.xhp#cellcopy"/>
   
  </section>
 </body>
</helpdocument>
