Work with data
Create and use pivot tables
You can use pivot tables to narrow down a large data set or analyze relationships between data points.
Add and edit pivot tables
- On your computer, open Google Sheets.
- Open the spreadsheet with the data you want to put in a table.
- Select the cells with data you want to use.
- Put the data you want to use into columns. Each column is one data set.
- Each column needs a header.
- In the menu, click Data Pivot table. Click the pivot table sheet, if it’s not already open.
- Next to each category in the "Report editor" window, click Add field, then click a column to use.
- Your table has one row or column for each number in the column you use, even if the number is in more than one cell.
- Data from the columns you use for "Values" is sorted into the matching rows and columns.
- If you want to add a field to the "Values" category that calculates values based on a formula, click Calculated field and enter the formula.
- "Filters" hide data that you don't want to show in the table.
- You can change how your data is listed, sorted, summarized or filtered. Next to what you want to change, click the Down Arrow .
- To format the pivot tables, use the buttons in the toolbar.
Change or remove data
- To move a data set from one category to another, drag it to the category you want.
- To remove a data set from a category, click Remove .
- To expand the range of data used for your pivot table, click Edit range.
- The pivot table refreshes any time you change the cells it's drawn from.
Name a range of cells
You can name ranges in Google Sheets to keep better track of them and create cleaner formulas.
For example, instead of using "A1:B2" to describe a range of cells, you could name the range "budget_total." This way, a formula like "=SUM(A1:B2, D4:E6)" could be written as "=SUM(budget_total, quarter2)."
Name a range
- Open a spreadsheet in Google Sheets.
- Select the cells you want to name.
- Click Data Named ranges. A menu will open on the right.
- Type the range name you want.
- To change the range, click Spreadsheet .
- Select a range in the spreadsheet or type the new range into the text box, then click Ok.
- Click Done.
Range names:
- Can contain only letters, numbers, and underscores.
- Can't start with a number, or the words "true" or "false."
- Can't contain any spaces or punctuation.
- Must be 1–250 characters.
- Can't be in either A1 or R1C1 syntax. For example, you might get an error if you give your range a name like "A1:B2" or "R1C1:R2C2."
Edit or delete a named range
- Open a spreadsheet in Google Sheets.
- Click Data Named ranges.
- On the named range you want to edit or delete, click Edit .
- To edit the range, enter a new name or range, then click Done.
- To delete the named range, next to the name, click Delete .
- On the menu that opens, click Remove.
Note: When you delete a named range, any formulas that reference it will no longer work. Protected ranges that reference a named range will use the cell values and continue to work.
Sort and filter your data
You can sort and filter data in Google Sheets to organize and analyze it.
Note: Filter views are only available on a computer. See the FILTER article for info about the function.
FILTER
Returns a filtered version of the source range, returning only rows or columns which meet the specified conditions.
Sample Usage
FILTER(A2:B26, A2:A26 > 5, D2:D26 < 10)
FILTER(A2:C5, {TRUE; TRUE; FALSE; TRUE})
FILTER(A2:B10, NOT(ISBLANK(A2:A10)))
Syntax
FILTER(range, condition1, [condition2, ...])
range
- The data to be filtered.condition1
- A column or row containing true or false values corresponding to the first column or row ofrange
, or an array formula evaluating to true or false.condition2 ...
- [ OPTIONAL ] - Additional rows or columns containing boolean valuesTRUE
orFALSE
indicating whether the corresponding row or column inrange
should pass throughFILTER
. Can also contain array formula expressions which evaluate to such rows or columns. All conditions must be of the same type (row or column). Mixing row conditions and column conditions is not permitted.condition
arguments must have exactly the same length asrange
.
Notes
FILTER
can only be used to filter rows or columns at one time. In order to filter both rows and columns, use the return value of oneFILTER
function asrange
in another.- If
FILTER
finds no values which satisfy the provided conditions,#N/A
will be returned.
See Also
UNIQUE
: Returns unique rows in the provided source range, discarding duplicates. Rows are returned in the order in which they first appear in the source range.Sort your data
- Open a spreadsheet in Google Sheets.
- Highlight the group of cells you'd like to sort. To select the entire sheet, click the top left corner of the sheet.
- Click Data Sort range.
- If your columns have titles, click Data has header row.
- Select the column you'd like to be sorted first and whether you would like that column sorted in ascending or descending order. This also sorts numbers.
- Click +Add another to add another sorting rule. Sorting will be done according to the order of your rules.
- To delete a rule, click Close .
- Click Sort. Your range will be sorted.
Filter your data
To see and analyze data in a spreadsheet, use filters. Filters let you hide data that you don’t want to see. You’ll still be able to see all your data when you turn the filter off.
Filters vs. filter views
Both filters and filter views help you analyze a set of data in a spreadsheet.
Filters can be useful if:
- You want everyone viewing your spreadsheet to see a specific filter when they open it.
- You want your data to stay sorted after using the filter.
Filter views can be useful if:
- You want to save multiple views.
- You want to name your view.
- You want others to be able to view the data differently. Since filter views need to be turned on by each person viewing a spreadsheet, each person can view a different filter view at the same time.
- You want to share different filters with people. You can send different filter view links to different people so everyone will see the most relevant information for them.
- You want to make a copy or create another view with similar rules.
- You don't have edit access to a spreadsheet and still want to filter or sort. In this case, a temporary filter view will be created.
Note: You can import and export filters, but not filter views.
Use filters in a spreadsheet
To temporarily hide data in a spreadsheet, add a filter.
Note: When you add a filter, anyone with access to your spreadsheet will see the filter too. Anyone with permission to edit your spreadsheet will be able to change the filter.
Filter your data
Sort your data while it’s filtered
Create, name, and save a filter view
Use a filter view when:
- You want to save your filter and use it later.
- You don't want to disrupt others' view of the data.
- You want to share a link to a specific filter with others.
- You can’t edit a spreadsheet, but you want to filter or sort data.
Create, save, or delete a filter view
Rename a filter view
See an existing filter view
Save a filter as a filter view
Use filter view with "view only" access
Comments
Post a Comment