7 ways to use advance filter.pdf
TRANSCRIPT
-
Self-Publishing
ALL RIGHTS RESERVED. This book contains material protected under International and Federal Copyright Laws and Treaties. Any unauthorized reprint or use of this material is prohibited. No part of this book may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system without express written permission from the author / publisher.
The information in this book is provided on as-is basis. The authors and publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.
Author- Excel Forum.com and Exceltip.com Cover Design- Published by- Self-publishing First Published in- April 2015
www.excelforum.com
7 Ways toUse Advance Filter
2015 & excelforum.com exceltip.com
-
Hello User,
Greetings from ExcelForum & Exceltip!
In this E-book we are offering you 7 ways of using
Advance Filter
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
Advance Filter is the most powerful feature of Excel. The advanced filtering feature in Excel allows you to quickly copy unique information from one data list to another. It allows the person to quickly remove duplicates, extract records that meet certain criteria. It works great when we use wildcards, within 2 date criteria.
Filtering is a simple, however, amazing & powerful way to analyze data. Advance filter are quite easy to use. Here's how you can use Excel's advanced filtering capabilities.
-
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
1. Using And, Or and Multiple Criteria
2. How to Filter Unique Records?
3. How to Use Wildcards?
4. Extract records after specific date criteria
5. Extract items between 2 Date's criteria
6. How to extract data with specific text?
7. How to extract data to another worksheet using VBA?
ADVANCE FILTER INDEX:
-
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
Let us start with creating Advanced Filter
Below shown picture is the example of data that we will use in this example
-
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
Click on any cell in the above mentioned data
Click on Data ribbon
From Sort & Filter group, click on Advanced
Advanced Filter dialog box will pop up
or use ALT + A + Q, ashortcut key
-
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
The List range box will automatically takes the data range (eliminates the step for user to select whole data
In Criteria range; select the criteria range as I1:N2
Select Copy to another location & enter cell I5 in Copy to; wherein advance filtered data will be retrieved.
-
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
Click on OK button will give us the filtered data.Refer below snapshot.
All the rows which contain Manager as Susan will get extracted.
-
1. Using And, Or and Multiple Criterias
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
1.1 And Criteria
Following picture contains range I1:N2 wherein we have couple of criteria:aa
1) State should be Colorado
2) Manager should be Susan
Advance filter will retrieve the data that matches both the conditions; we need to follow the below steps:
-
1. Using And, Or and Multiple Criterias
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
Use ALT + A + Q to launch Advanced Filter dialog box
The List range box will contain range A1:F273; the whole data table In Criteria range,select the criteria range as I1:N2 Select Copy to another location & enter cell I5 in Copy to; wherein advance filtered data will be retrieved
Click on OK button will give us the filtered data.Refer below snapshot
-
1. Using And, Or and Multiple Criterias
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
In this way, we can use AND condition to get the data that matches both the conditions.We can have multiple conditions to get the output that matches all the conditions.
1.2 or Criteria
Following is the picture of OR criteriaAdvance filter will look for any one condition:
1) Manager should be Susan & Process should be XYZ
2) Manager should be Ronald & Process should be PMP
-
1. Using And, Or and Multiple Criterias
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
If any condition is met then the data will be extracted Use ALT + A + Q to launch Advanced Filter dialog box
-
1. Using And, Or and Multiple Criterias
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
The full data will be listed in List range In Criteria range, select the criteria range as I1:N3 Select Copy to another location & enter cell I5 in Copy to; wherein advance filtered data will be retrieved
Click on OK button will give us the filtered data.Refer below snapshot.
In this way, we can use OR condition to get the data that matches any one condition & produces result accordingly.
-
1. Using And, Or and Multiple Criterias
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
1.3 Multiple Criteria
Following is the picture of Multiple CriteriaAdvance filter will check for data that matches all the entries in a row; if all the conditions will meet in a row then the data will be retrieved using advanced filter.
We need to follow the below steps: Use ALT + A + Q to launch Advanced Filter dialog box
-
1. Using And, Or and Multiple Criterias
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
Enter the data range in List range field
In Criteria range, select the criteria range as I1:N3
Select Copy to another location & enter cell I5 in Copy to; wherein advance filtered data will be retrieved.
Click on OK button will give us the filtered data.Refer below snapshot
-
1. Using And, Or and Multiple Criterias
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
In this way, we can use multiple conditions to get the data that matches any one condition &gets us the result..
-
2. How to Filter Unique Records?
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
Advance filter can be used to filter unique records or removing duplicate records from the database. To get unique list of Managers, we will copy the unique list in different location other than the original list.
Note: The list must contain a heading, or the first item may be duplicated in the results.
We need to follow the below steps:
Select a cell in the database or use shortcut key ALT + A + Q
Select Copy to another location
In List range, select column E
Do not select anything as Criteria range
In Copy to field, enter the cell wherein you want to paste the unique records
The last step is to tick on the Unique records only
By clicking OK button, we will get the following list of all the Managers
-
2. How to Filter Unique Records?
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
In this way, we can use advance filter to extract unique records.
-
3. How to Use Wildcards?
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
We can use Asterisk (*) & Question mark (?) wildcards.
The * Wildcard
Following is the snapshot of the example that we are going to use
From above data, we will use Wildcard Asterisk (*) to represent any number of characters in that position
We have enteredAL* in State column Advance filter will look for all the states that start with characters as AL
-
3. How to Use Wildcards?
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
Press ALT + A + Q for launching advance filter dialog box & follow the below ranges in the fields
This example will produce the following list of States that contain characters AL
-
3. How to Use Wildcards?
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
The ? Wildcard
We will use question mark Wildcard (?).It represents one character within a string or text in that position
We need to follow the below steps:
We have Boys Clothing ???Yrsas Wildcard in Product column
Advance filter will look for all the text that meets the condition & extract the result.
The 3 question marks represent 3 characters
In this example, there are two Boys Clothing slabs i.e. 0-5 Yrs& 6-8 Yrs.
The question mark wild card will pull out both the entries
Press ALT + A + Q for launching advance filter dialog box & follow the below ranges in the fields
-
3. How to Use Wildcards?
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
-
4. Extract records after specific date criteria
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
Following is the picture of criteria that will be referred at the time of extracting data.In this example, any records that fall after the criteria date (>3/31/2015) will be retrieved
Press ALT + A + Q for launching advance filter dialog box & follow the below ranges in the fields
-
4. Extract records after specific date criteria
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
This example will extract the data that falls after the specific date.Refer below snapshot
-
5. Extract items between 2 Dates criteria
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
Following is the picture of criteria that need to be looked for data that occurs between 1/1/2014 & 12/31/2014
Press ALT + A + Q for launching advance filter dialog box & follow the below ranges in the fields
-
5. Extract items between 2 Dates criteria
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
This example will extract the data that contains between the two criteria dates.Refer below snapshot
-
6. How to extract data with specific text?
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
We can use advance filter to derive the items that contain specific text.In this example, we will use =Tablets in Product column. Advance Filter will find all the rows that contain Tablets in Product column.
Following is the picture of specific text criteria
Press ALT + A + Q for launching advance filter dialog box & follow the below ranges in the fields
-
6. How to extract data with specific text?
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
In this example, we will get a list of Product as Tablets.Refer below snapshot for better understanding:
-
7. How to extract data to another worksheet using VBA?
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
We have employee database with Employee Name, State, Emp Id, Manager & Process.
(Refer to Extract data to another worksheet using VBA.xlsm file saved in 7 ways to use Advance Filter.zip folder. The file contains raw data, output and macro code.)
The above data contains more than 250 rows. Now, we want user to select Name, Manager& Process from dropdown lists.
The information should be updated in another sheet with a single click
-
7. How to extract data to another worksheet using VBA?
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
To get the output on the above shown multiple criteria, we require VBA code.We need to follow the below mentioned steps to launch VB editor
Click on Developer tab From Code group, select Visual Basic or simply press ALT +F11 to launch VBA screen
Click on Insert, and then on Module
This will create a new module.
Enter the following code in the Module
-
7. How to extract data to another worksheet using VBA?
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
Sub AdvanceFilter()
Sheet2.Range("A4:F10000").Clear
Sheet1.Range("A1").CurrentRegion.AdvancedFilter _
Action:=xlFilterCopy, CriteriaRange:=Sheet2.Range("A1:E2"), _
CopyToRange:=Sheet2.Range("A7:F7"), Unique:=False
Columns(4).AutoFit
End Sub
We can assign the macro to GO button. After clicking the GO button, we will get the following result
-
7. How to extract data to another worksheet using VBA?
w w w . e x c e l t i p . c o m l w w w . e x c e l f o r u m . c o m
Copyright 2003 ExcelTip.com, Excelforum.com. registered trademark of Microsoft Corporation.
7 Ways to Use Advance Filter
The above VBA code will automatically update the result as we change Employee Name, Manager or Process.
In this way, using Advance Filterthrough VBA,we can extract data on multiple conditions.
Page 1Page 2Page 3Page 4Page 5Page 6Page 7Page 8Page 9Page 10Page 11Page 12Page 13Page 14Page 15Page 16Page 17Page 18Page 19Page 20Page 21Page 22Page 23Page 24Page 25Page 26Page 27Page 28Page 29Page 30Page 31Page 32