国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

Table of Contents
Quick Links
Required Fields
PIVOTBY: Using the Required Arguments Only
How to Name a Table in Microsoft Excel
The Beginner’s Guide to Excel’s Formulas and Functions
Example 1: Grand Totals and Subtotals
Example 3: Percentages (PERCENTOF)
Use the PERCENTOF Function to Simplify Percentage Calculations in Excel
Home Software Tutorial Office Software How to Use the PIVOTBY Function in Excel

How to Use the PIVOTBY Function in Excel

Apr 11, 2025 am 12:56 AM

  • The PIVOTBY Syntax
  • PIVOTBY: Using the Required Arguments Only
  • PIVOTBY: Using the Optional Arguments

Excel's PIVOTBY function allows you to group your figures without needing to recreate your data in a PivotTable. What's more, data summaries created via PIVOTBY automatically update to reflect changes in your original data, and you can customize what they show by tweaking the formula.

The PIVOTBY Syntax

The PIVOTBY function lets you input a total of 11 arguments. Although this sounds daunting, the benefit of having so many arguments is that you can tailor the result to align with what you want the data to show.

However, only the first four fields are required.

Required Fields

The required PIVOTBY fields are where you tell Excel which variables you want to be displayed in rows, which variables you want to be displayed in columns, where to find the values, and how you want to aggregate your data:

=PIVOTBY(<em>a</em>,<em>b</em>,<em>c</em>,<em>d</em>)

where

  • a are the cells containing the category or categories you want to appear as row headers down the left-hand side of your result,
  • b are the cells containing the category or categories you want to appear as column headers across the top of your result,
  • c are the values that will appear in the center of your result, according to the rows and columns you selected for arguments a and b, and
  • d is the Excel function (or function you've created yourself through LAMBDA) that defines how the data will be aggregated.
Optional Fields

The optional PIVOTBY fields allow you to include headers and totals, sort your data, and—in very specific circumstances—specify some additional parameters:

=PIVOTBY(<em>a</em>,<em>b</em>,<em>c</em>,<em>d</em>,[<em>e</em>,<em>f</em>,<em>g</em>,<em>h</em>,<em>i</em>,<em>j</em>,<em>k</em>])

Argument

What It Is

Notes

e

A number that specifies whether arguments a, b, and c include headers and whether you want headers to be displayed in the result

0 = No headers (default)

1 = Headers, but don't show

2 = No headers, but generate them

3 = Headers, and show

f

A number that determines whether argument a should contain grand totals and subtotals

0 = No totals

1 = Grand totals at the bottom (default)

2 = Grand totals and subtotals at the bottom

-1 = Grand totals at the top

-2 = Grand totals and subtotals at the top

g

A number indicating how the columns should be sorted

The number refers to the columns in argument a, followed by the column in argument c. For example, if you had two columns in argument a, "2" would sort the result by the second column of this argument, and "3" would sort the result by argument c. A positive number represents alphabetical or ascending order, and a negative number represents the reverse.

h

A number that determines whether argument b should contain grand totals and subtotals

0 = No totals

1 = Grand totals on the right (default)

2 = Grand totals and subtotals on the right

-1 = Grand totals on the left

-2 = Grand totals and subtotals on the left

i

A number that indicates how the rows should be sorted

The number refers to the columns in argument b, followed by the column in argument c, and works in the same way as argument g.

j

A logical expression or formula that lets you filter out rows containing certain values or text

N/A

k

A number that gives you more control over how the result's calculations are performed when you use the PERCENTOF function in argument d

0 = Column totals (default)

1 = Row totals

2 = Grand total

3 = Parent column total

4 = Parent row total

PIVOTBY: Using the Required Arguments Only

First, let me show you how to use the PIVOTBY function in its simplest form with just the four required fields.

Let's say you've been handed this table of data named Sports_Viewers. It shows the live viewing figures (column D) for six sports (column B) across four regions (column C) over four years (column A), and you've been asked to generate a summary of total viewers by sport and year.

How to Use the PIVOTBY Function in Excel

How to Use the PIVOTBY Function in Excel

Related
How to Name a Table in Microsoft Excel

"Table1" doesn't explain much...

You could use the GROUPBY function to do this, though you would need to use optional arguments to produce a result that makes analysis easier. What's more, since GROUPBY only sorts data into rows, you could end up with a long list of information that is difficult to interpret.

How to Use the PIVOTBY Function in Excel

Instead, using the PIVOTBY function lets you take one or more of the variables and place them into columns, giving you a clearer picture of how your numbers stack up.

PIVOTBY: Using the Optional Arguments

Whenever you create an Excel formula, each argument is separated by a comma. This means that if you want to skip over any of the optional arguments, you simply need to type a first comma to open the argument, followed by a second comma to close it. The fact that there's nothing between these two commas tells Excel that you've deliberately omitted this argument, so you want the program to adopt the default setting.

How to Use the PIVOTBY Function in Excel

Related
The Beginner’s Guide to Excel’s Formulas and Functions

Everything you need to know about Excel's engine room.

1

Example 1: Grand Totals and Subtotals

One way to make the PIVOTBY result in the previous example clearer would be to add subtotal rows for each sport.

To do this, you need to type:

=PIVOTBY(Sports_Viewers[[Sport]:[Region]],Sports_Viewers[Year],Sports_Viewers[Viewers],SUM,,2)

Notice how, after argument d (SUM), two commas indicate that you want to jump over argument e (headers), but include argument f (in this case, 2 means that you want to include a subtotal at the bottom of each sport, as well as grand totals at the bottom of the overall result).

How to Use the PIVOTBY Function in Excel

Example 2: Sort Order

Now, let's look at another way to manipulate your result: sorting by one of the output columns.

Typing:

=PIVOTBY(Sports_Viewers[[Sport]:[Region]],Sports_Viewers[Year],Sports_Viewers[Viewers],SUM,,2,3)

means that, after skipping over argument e, as well as including grand totals and subtotals (number 2 in argument f), you also want to order your data by overall viewing figures in ascending order (number 3 in argument g).

How to Use the PIVOTBY Function in Excel

Notice how sorting by total viewing figures places not only the sports in order according to their overall totals, but also the regional subcategories according to their subtotals.

Example 3: Percentages (PERCENTOF)

Here's how to view your result using percentages.

Typing:

=PIVOTBY(Sports_Viewers[Sport],Sports_Viewers[Year],Sports_Viewers[Viewers],PERCENTOF,,,2,,,,2)

tells Excel that you want the sports as the row headers (argument a), the years as the column headers (argument b), and you want to aggregate your data (argument c) in the form of percentages (argument d). The first 2 (argument g) represents the order, which, in this case, is by the values. Finally, the second 2 (argument k) tells Excel that the percentages should be relative to the overall data. The unpopulated commas tell Excel you want it to adopt the default for arguments e, f, h, i, and j.

How to Use the PIVOTBY Function in Excel

How to Use the PIVOTBY Function in Excel

Related
Use the PERCENTOF Function to Simplify Percentage Calculations in Excel

Handle percentages like a pro!

Now, select the cells containing the decimalized results, and click the "Percent Style" icon in the Number group of the Home tab on the ribbon. While you're there, click the "Increase Decimal" and "Decrease Decimal" buttons to define the number of decimal places.

Select extra rows beneath the result in case more data is added to the original table in the future.

How to Use the PIVOTBY Function in Excel

Finally, take a moment to digest what this result tells you.

How to Use the PIVOTBY Function in Excel

For example, the number of people watching softball in 2022 constitutes 11.5% of the overall viewing figures for all sports across all years. Also, because the data is organized by the total column in ascending order, you can see that nearly a quarter (23.7%) of the overall viewing figures came from people watching basketball.


As well as using SUM, AVERAGE, and PERCENTOF for the function argument in PIVOTBY, you can also use other aggregation functions, like COUNT, MIN, or MAX.

The above is the detailed content of How to Use the PIVOTBY Function in Excel. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to Use Parentheses, Square Brackets, and Curly Braces in Microsoft Excel How to Use Parentheses, Square Brackets, and Curly Braces in Microsoft Excel Jun 19, 2025 am 03:03 AM

Quick Links Parentheses: Controlling the Order of Opera

How to insert date picker in Outlook emails and templates How to insert date picker in Outlook emails and templates Jun 13, 2025 am 11:02 AM

Want to insert dates quickly in Outlook? Whether you're composing a one-off email, meeting invite, or reusable template, this guide shows you how to add a clickable date picker that saves you time. Adding a calendar popup to Outlook email

Outlook Quick Access Toolbar: customize, move, hide and show Outlook Quick Access Toolbar: customize, move, hide and show Jun 18, 2025 am 11:01 AM

This guide will walk you through how to customize, move, hide, and show the Quick Access Toolbar, helping you shape your Outlook workspace to fit your daily routine and preferences. The Quick Access Toolbar in Microsoft Outlook is a usefu

Prove Your Real-World Microsoft Excel Skills With the How-To Geek Test (Intermediate) Prove Your Real-World Microsoft Excel Skills With the How-To Geek Test (Intermediate) Jun 14, 2025 am 03:02 AM

Whether you've secured a data-focused job promotion or recently picked up some new Microsoft Excel techniques, challenge yourself with the How-To Geek Intermediate Excel Test to evaluate your proficiency!This is the second in a three-part series. The

How to Switch to Dark Mode in Microsoft Excel How to Switch to Dark Mode in Microsoft Excel Jun 13, 2025 am 03:04 AM

More and more users are enabling dark mode on their devices, particularly in apps like Excel that feature a lot of white elements. If your eyes are sensitive to bright screens, you spend long hours working in Excel, or you often work after dark, swit

How to Delete Rows from a Filtered Range Without Crashing Excel How to Delete Rows from a Filtered Range Without Crashing Excel Jun 14, 2025 am 12:53 AM

Quick LinksWhy Deleting Filtered Rows Crashes ExcelSort the Data First to Prevent Excel From CrashingRemoving rows from a large filtered range in Microsoft Excel can be time-consuming, cause the program to temporarily become unresponsive, or even lea

Microsoft Excel Essential Skills Test Microsoft Excel Essential Skills Test Jun 12, 2025 pm 12:01 PM

Whether you've landed a job interview for a role that requires basic Microsoft Excel skills or you're looking to solve a real-world problem, take the How-To Geek Beginner Excel Test to verify that you understand the fundamentals of this popular sprea

Google Sheets IMPORTRANGE: The Complete Guide Google Sheets IMPORTRANGE: The Complete Guide Jun 18, 2025 am 09:54 AM

Ever played the "just one quick copy-paste" game with Google Sheets... and lost an hour of your life? What starts as a simple data transfer quickly snowballs into a nightmare when working with dynamic information. Those "quick fixes&qu

See all articles