28
Unleash the Power of Microsoft Excel document.docx Mastering Software Unlimited

Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

Unleash the Power of Microsoft Excel

document.docxMastering Software Unlimited

Page 2: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

ContentsCreating Subtotals....................................................................................................3

SumIf and SumIfs.....................................................................................................4

SUMIF...................................................................................................................4

SUMIFS.................................................................................................................5

Data Filters...............................................................................................................6

Insert Tables.............................................................................................................7

Expanding the Table.............................................................................................7

Using Filters and Multilevel Sorting.....................................................................7

Slicers Instead of Filters.......................................................................................8

Vlookup Function.....................................................................................................9

Pivot Tables............................................................................................................10

Pivoting Data......................................................................................................13

Filters.................................................................................................................16

Slicers.................................................................................................................18

PivotCharts.........................................................................................................19

Date Validation with Multiple Selection.................................................................22

2

Page 3: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

Creating SubtotalsSubtotal feature is a great way to automatically insert a Sum, Count, Average, Max, Min subtotal to your data set with a press of a button.

This feature is located under the Excel Data tools menu: Data > Subtotal

1. Highlight your data and go to Data > Subtotal.2. This will open up the Subtotal dialogue box (see image below).3. At each change: Select which column you want to use to separate the data.

Make sure that the data in the selected column is in ascending/descending order4. Use function: Select which function you want to use for you calculation. You can

select from Sum, Count, Average, Maximum, Minimum, Product, Count Numbers, StdDev, StdDevp, Var, Varp

5. Add subtotal to: Select the column that you want to Subtotal6. Press OK and this will add extra lines to your data with zthe chosen Subtotal7. If you want to change the Subtotal (say from a Sum to an Average) all you

have to do is click in your data and go to Data > Subtotal and it will bring up the Subtotal dialogue box once again. Under Use function select Average and press OK.

3

Page 4: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

SumIf and SumIfsSUMIFYou use the SUMIF function to sum the values in a range that meet criteria that is specified.

SUMIF(range, criteria, [sum_range])

Arguments:

range - The range of cells that you want to apply the criteria against. criteria - The criteria used to determine which cells to add. sum_range - [optional] The cells to add together. If sum_range is omitted,

the cells in range are added together instead.

Notes:

When sum_range is omitted, the cells in range will be summed. Text criteria, or criteria that includes math symbols, must be enclosed in double

quotation marks ("). Numeric criteria can be supplied without quotation marks. The wildcard characters ? and * can be used in criteria. A question mark

matches any one character and an asterisk matches any sequence of characters.

To find a literal question mark or asterisk, use a tilde (~) in front question mark or asterisk (i.e. ~?, ~*).

4

Page 5: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

SUMIFSThe SUMIFS function adds all of its arguments that meet multiple criteria.

Syntax

SUMIFS(sum_range, criteria_range1, criteria1, [criteria_range2, criteria2], ...)

Arguments:

sum_range - The range to be summed. range1 - The first range to evaulate. criteria1 - The criteria to use on range1. range2 - [optional] The second range to evaluate. criteria2 - [optional] The criteria to use on range2.

SUMIFS sums cells in a range that match supplied criteria. Unlike the SUMIF function, SUMIFS can apply more than one set of criteria, with more than one range. The first range is the range to be summed. The criteria is supplied in pairs (range/criteria) and only the first pair is required. For each additional criteria, supply an additional range/criteria pair. Up to 127 range/criteria pairs are allowed.

Notes:

Each additional range must have the same number of rows and columns as the sum_range.

Non-numeric criteria must be enclosed in double quotes, but numeric criteria does not need quotes except with operators, i.e. ">32"

The wildcard characters ? and * can be used in criteria. A question mark matches any one character and an asterisk matches any sequence of characters.

To find a literal question mark or asterisk, use a tilde (~) in front question mark or asterisk (i.e. ~?, ~*).

SUMIF and SUMIFS can handle ranges, but not arrays. This means you can't use other functions like YEAR on the criteria range, since the result is an array. If you need this functionality, use the SUMPRODUCT function.

The order of arguments is different between the SUMIFS and SUMIF functions. Sum_range is the first argument in SUMIFS, but the third argument in SUMIF.

*This process can be used for AVERAGEIF, AVERAGEIFS, COUNTIF, and COUNTIFS

5

Page 6: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

6

Page 7: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

Data FiltersWhen the worksheet contains a lot of content, it can be difficult to find information quickly. Filters can be used to narrow down the data in your worksheet, allowing you to view only the information you need.

1. In order for filtering to work correctly, your worksheet should include a header row, which is used to identify the name of each column.

2. Select the Data tab, then click the Filter command.

3. A drop-down arrow will appear in the header cell for each column.4. Click the drop-down arrow for the column you want to filter.5. The Filter menu will appear.6. Uncheck the box next to Select All to quickly deselect all data.7. Check the boxes next to the data you want to filter, then click OK. 8. The data will be filtered, temporarily hiding any content that doesn't match the

criteria. In our example, only laptops and tablets are visible.

7

Page 8: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

Insert Tables1. Highlight the entire table including the headers; by clicking CTRL+A. This

highlights the entire table in one stroke, as long as your cursor is positioned somewhere/anywhere inside the table range.

2. Select the tab and button: Insert > Table3. Click OK.

Expanding the Table1. Click on the blank row below the table. Enter the information and the table will

automatically expand.2. Click on the column next to the table. Enter the new label and the table will

automatically expand.

Using Filters and Multilevel Sorting1. The Insert > Table command automatically places down arrow symbols next to

each label. Click on one arrow to filter that column. Choose the items you want to filter.

2. Continue to use the other down arrows to create a multilevel filter.3. To clear filter, click on the down key on the label and choose clear filter.4. To create a multilevel sort, click in the table. Home Tab > Sort & Filter > Custom

Sort…

8

Page 9: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

Slicers Instead of FiltersSlicers provide buttons that you can click to filter table data, or PivotTable data. In addition to quick filtering, slicers also indicate the current filtering state, which makes it easy to understand what exactly is shown in a filtered PivotTable.

For Tables: Click Table tab, click Insert Slicers

For Pivot Tables: Click Table Tools menu, click Design tab, click Insert Slicers

When you select an item, that item is included in the filter and the data for that item will be displayed in the report.

Slicers has it owns menu. You can change the number of columns and color for each slicer.

Use Total Row with Slicers to be more proficient in filtering the database.

9

Page 10: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

Vlookup FunctionThere are 2 ways you can use Vlookup. The first way is to search and return a value from the same sheet. The second way is to search and return a value from another sheet.

1. Make sure the list is named.2. The Vlookup command is used the same way for both options.3. The lookup value must be in the first column of the named list.4. Formulas Tab > Lookup & Reference Tab > VLOOKUP5. Number1 is for the value to lookup in the first column, Number 2 is the named list

(naming a list saves you time in highlight the entire table), Number 3 is the column of the list that contains the value to be returned and Number 4 must be False for an exact match. Leaving it blank is for an approximation.

10

Page 11: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

Pivot TablesSetting Up Data for Use In Pivot Tables

1. Organize data in columns with headings. These headings will be used when you create the pivot table, and things will get very confusing without headings. -

2. Make sure there are no empty columns or rows in your data. Excel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK.

a. A whole row of column of empty cells is NOT OK. 3. Consistent data in all cells.

a. If you have a date column, make sure all values in that column are dates (or blank).

b. If you have a quantity column, make sure all values are numbers (or blank) and not words.

Let's say we wanted to answer the question: What is the amount sold by each salesperson? for the sales data in the example below. Answering this question could be time consuming and difficult—each salesperson appears on multiple rows, and we would need to total all of their different orders individually. We could use the Subtotalcommand to help find the total for each salesperson, but we would still have a lot of data to work with.

11

Page 12: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

Fortunately, a PivotTable can instantly calculate and summarize the data in a way that's both easy to read and manipulate. When we're done, the PivotTable will look something like this:

Once you've created a PivotTable, you can use it to answer different questions by rearranging—or pivoting—the data. For example, if we wanted to answer the question: What is the total amount sold in each month? we could modify our PivotTable to look like this:

To create a PivotTable

1. Select the table or cells (including column headers) containing the data you want to use.

2. From the Insert tab, click the PivotTable command.3. The Create PivotTable dialog box will appear.

Choose your settings, then click OK. In our example, we'll use Table1 as our source data and place the PivotTable on a new worksheet.

12

Page 13: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

4. A blank PivotTable and Field List will appear on a new worksheet.

5. Once you create a PivotTable, you'll need to decide which fields

to add. Each field is simply a column headerfrom the source data. In the PivotTable Field List, check the box for each field you want to add. In our example, we want to know the total amount sold by each salesperson, so we'll check the Salesperson and Order Amount fields.

6. The selected fields will be added to one of the four areas below the Field List. In our example, the Salesperson field has been added to the Rows area, while the Order Amount has been added to the Valuesarea. Alternatively, you can click, hold, and drag a field to the desired area.

7. The PivotTable will calculate and summarize the selected fields. In our example, the PivotTable shows the amount sold by each salesperson.

Just like with normal spreadsheet data, you can sort the data in a PivotTable using the Sort & Filter command in the Home tab. You can also apply any

13

Page 14: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

type of number formatting you want. For example, you may want to change the Number Format to Currency. However, be aware that some types of formatting may disappear when you modify the PivotTable.

If you change any of the data in your source worksheet, the PivotTable will not update automatically. To manually update it, select the PivotTable and then go to AnalyzeRefresh.

Pivoting DataOne of the best things about PivotTables is that they can quickly pivot—or reorganize—data, allowing you to look at your worksheet data in different ways. Pivoting data can help you answer different questions and even experiment with the data to discover new trends and patterns.

In our example, we used the PivotTable to answer the question: What is the total amount sold by each salesperson? But now we'd like to answer a new question: What is the total amount sold in each month? We can do this by simply changing the field in the Rows area.

14

Page 15: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

To change the row

1. Click, hold, and drag any existing fields out of the Rows area. The field will disappear.

2. Drag a new field from the Field List into the Rows area. In our example, we'll use the Month field.

15

Page 16: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

3. The PivotTable will adjust—or pivot—to show the new data. In our example, it now shows the total order amount for each month.

To add columns

So far, our PivotTable has only shown one column of data at a time. In order to show multiple columns, you'll need to add a field to the Columns area.

1. Drag a field from the Field List into the Columns area. In our example, we'll use the Region field.

16

Page 17: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

2. The PivotTable will include multiple columns. In our example, there is now a column for each region.

FiltersSometimes you may want focus on just a certain section of your data. Filters can be used to narrow down the data in your PivotTable, allowing you to view only the information you need.

To add a filter

1. Drag a field from the Field List to the Filters area. In this example, we'll use the Salesperson field.

17

Page 18: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

2. The filter will appear above the PivotTable. Click the drop-down arrow, then check the box next to Select Multiple Items.

3. Uncheck the box for any items you don't want to include in the PivotTable. In our example, we'll uncheck the boxes for a few different salespeople, then click OK.

4. The PivotTable will adjust to reflect the changes.

18

Page 19: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

SlicersSlicers make filtering data in PivotTables even easier. Slicers are basically just filters, but they're easier and faster to use, allowing you to instantly pivot your data. If you frequently filter your PivotTables, you may want to consider using slicers instead of filters.

To add a slicer

1. Select any cell in the PivotTable.2. From the Analyze tab, click the Insert Slicer command.

3. A dialog box will appear. Select the desired field. In our example, we'll select Salesperson, then click OK.

4. The slicer will appear next to the PivotTable. Each selected item will be highlighted in blue. In the example below, the slicer contains a list of all salespeople, and six of them are currently selected.

19

Page 20: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

5. Just like filters, only selected items are used in the PivotTable. When you select or deselect items, the PivotTable will instantly reflect the changes. Try selecting different items to see how they affect the PivotTable. Press and hold the Ctrl key on your keyboard to select multiple items from a slicer.

You can also click the Filter icon in the top-right corner to select all items from the slicer at once.

PivotChartsPivotCharts are like regular charts, except they display data from a PivotTable. Just like regular charts, you'll be able to select a chart type, layout, and style that will best represent the data.

To create a PivotChart

1. Select any cell in your PivotTable.

20

Page 21: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

2. From the Insert tab, click the PivotChart command.

3. The Insert Chart dialog box will appear. Select the desired chart type and layout, then click OK.

21

Page 22: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

4. The PivotChart will appear.

Try using slicers or filters to change the data that is displayed. The PivotChart will automatically adjust to show the new data.

22

Page 23: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

Date Validation with Multiple SelectionThe Data Validation feature is a List option to confine selections in a cell to a preconfigured series of values. This selection can further influence the values in another list by presenting options that relate to the first choice. As an example, the first list might present a list of product categories that propagate a secondary list of product models. For this feature to work, the first drop-down list must conform to naming restrictions imposed on defined Excel ranges.

1. Click the "+" sign at the bottom to create a new sheet to use as a data source.2. Enter the values you need for the first drop-down list in column A on the new

sheet. These values should begin with a letter or underscore and not contain spaces.

3. Enter the respective secondary values in the next columns for each value entered in column A. For example, if you entered "Speakers," "Adapters" and "Cables" in cells A1 through A3, fill-in the appropriate values in columns B through D. Because you have three categories, you need three secondary columns, one as a secondary source list for each category. The secondary columns have no naming restrictions and can contain a different number of values.

4. Click and drag your mouse across the data cells in column A to select them. Click "Formulas," "Define Names" and then "Define Names."

5. Enter a descriptive name for the cells and click "OK." The name follows the same restrictions as described earlier. You can use varying capitalization in the name to help identify separate words, such as "ProductsCategories," but you do not need to mirror this capitalization when later referencing the defined range.

6. Define names for each secondary data list using the Define Names feature that was described earlier. The name for these lists should mirror the value of the main categories. In the previous example, cells B1 through B4 should be named "Speakers," cells C1 through C8 should be named "Adapters" and cells D1 through D5 should be named "Cables." These example ranges assume values are entered in each cell; you shouldn't include blank cells in the defined range.

7. Click the original sheet tab and select the blank cell in which the primary drop-down list should appear.

8. Click "Data," "Data Validation" and then "Data Validation" again.9. Click the "Allow" drop-down list and select "List."

23

Page 24: Creating Subtotals · Web viewExcel is good at sensing the start and end of a data table by looking for empty rows and columns at which point it stops. Empty cells are OK. A whole

10. Enter "=ProductCategories" (without quotes here and throughout) in the Source field and click "OK." This creates the primary drop-down list that feeds the secondary list.

11. Click the cell in which the secondary drop-down list should appear. Select "Data," "Data Validation," "Data Validation."

12. Click the "Allow" drop-down list and select "List."13. Enter "=Indirect(A1)" and click "OK." Change "A1" to reflect the cell address

where the primary drop-down list appears. If you receive an error, disregard it; it only appears because no option has been selected from the primary list yet. Once you select any option from the primary list, the secondary list changes to reflect the associated values.

14. Copy A1 down to several cells.15. Copy B1 down to several cells.

24