Pivot Tables in Excel are nice, proper? They get the job carried out, however solely till the second you should tweak the structure, add a brand new subject, refresh the numbers after a brand new knowledge dump arrives. Earlier than you begin scrambling by Excel’s UI, clicking by dozens of dialog bins and dragging fields round hoping you do not break one thing, know that there is a higher manner.
Excel has lots of of built-in formulation that allow you to do something from easy arithmetic to, you guessed it, constructing Pivot Tables. And now that Excel can write its personal formulation, there isn’t any motive why you should not be utilizing its PIVOTBY operate to rebuild the identical summaries in minutes as a substitute of hours.
Associated
Excel lastly mounted its greatest knowledge entry drawback, and it is a lifesaver
One click on within the Knowledge tab can catch nearly all points.
Cease clicking—construct Pivot Tables with formulation
A sooner, extra versatile approach to create dynamic summaries
Yadullah Abidi / MakeUseOf
First launched in Excel for Microsoft 365, PIVOTBY is a dynamic array operate that produces basically the identical type of cross-table summaries you’d get from a Pivot Desk, besides with zero handbook refreshing and much more automation and adaptability. It exhibits resutls routinely in as many cells as required and routinely updates because the supply knowledge adjustments.
The system itself is not sophisticated both. The syntax is solely:
PIVOTBY (row_fields, col_fields, values, operate)
Within the system above, row_fields is the column you need operating down the left facet, col_fields is what runs throughout the highest (typically a time period), the values argument is the info you need to work with and performance is the way you need to calculate it — SUM, AVERAGE, COUNT — you identify it, Excel can do it. There are different arguments to the system obtainable as properly, however these are the 4 required arguments you should present for PIVOTBY to work.
For instance you may have a gross sales desk with columns for Product, Nation and Quantity, and your present Pivot Desk exhibits whole gross sales by Product (in rows) and Nation (in columns). To rebuild this view utilizing the PIVOTBY system, simply use the next system in an empty cell
Screenshot by Yadullah Abidi | No Attribution Required.
=PIVOTBY(A2:A32, B2:B32, C2:C32, SUM)
As quickly as you hit Enter, Excel does the remainder. It’s going to group, combination, and lay out the total desk, and throw in grand totals by default.
OS
Home windows, macOS
Supported Desktop Browsers
All through internet app
Developer(s)
Microsoft
Free trial
One month
Altering layouts turns into easy
Rearrange fields with out rebuilding all the things from scratch
As you possibly can most likely guess, recreating and fine-tuning PIVOTBY tables can also be fairly straightforward as in comparison with conventional Pivot Tables. For instance, with a conventional Pivot Desk, including headers means going again into the sector settings. With PIVOTBY, you possibly can merely add a fifth parameter field_headers and select to indicate the default headers or routinely generate them if they do not exist within the supply knowledge. Need grand totals on the highest as a substitute of backside? Set row_total_depth to -1. Need to take away column totals? Set col_total_depth to 0. Each Pivot Desk tweak that you would need to fish by the Excel UI for is now a quantity in a system.
Filtering knowledge additionally turns into considerably simpler with PIVOTBY. Advanced filtering could be clunky in conventional Pivot Tables, however they are often written as common expressions in PIVOTBY. For instance, if you wish to see solely rows the place Nation is not the USA, add C2:C32″USA” on the finish of your system. Need to see a particular product from a particular nation? Merely multiply two IF statements and the outcomes will solely embrace gadgets that match each situations. Common Pivot Tables can have you including fields into the Filters space or including slicers all day lengthy as a substitute.
There are a number of gotchas to know
The place this method can journey you up
Yadullah Abidi / MakeUseOf
The one factor you want to remember earlier than utilizing PIVOTBY is that it depends on Excel tables to drag off the type of versatility it has. PIVOTBY would not routinely increase once you add new rows to your uncooked knowledge until it is formatted as an Excel desk. When you’re nonetheless working with a plain knowledge vary, you possibly can rapidly convert it right into a desk by choosing the info and urgent Ctrl + T.
PIVOTBY additionally will not routinely format the output for you, which Pivot Tables do. An ordinary Pivot Desk will add banded rows, daring headers, and highlighted totals by default. PIVOTBY does no such factor, however you need to use conditional formatting guidelines that apply routinely to the spill vary. This implies when you set it up, the formatting stays constant as your knowledge adjustments, expands, or shrinks. Excel additionally prompts its Fast Evaluation software when the output is generated, making formatting or charting simpler.
Final however not least, there are nonetheless conditions the place the old-school Pivot Desk remains to be higher. When you want slicers related to a number of visuals, when you’re working from a Energy Pivot knowledge mannequin, or in case your colleagues on older Excel variations must work together with the file, Pivot Tables stay your solely possibility.
PIVOTBY is proscribed to Excel for Microsoft 365, which means compatibility is a giant concern. In case your current Excel license would not assist PIVOTBY, Pivot Tables, as soon as once more, are the go-to alternative. Nonetheless, you do not should be a coder to make use of Python in Excel for knowledge cleansing, so if that is one other use case for you, an improve to Microsoft 365 may make sense, courtesy of its built-in Python assist. You too can use Copilot in Excel to make Pivot Tables simpler.
There’s a better approach to pull knowledge
Cleaner inputs that make your evaluation much more highly effective
When you’re already comfy with Pivot Tables, you have principally carried out the exhausting considering PIVOTBY wants. You realize what belongs in rows, what goes into columns, and which numbers matter. All you should change is the place that logic applies.
Associated
This Excel Trick Lets Me Write Formulation Like a Human
Smarter Excel formulation with the simplicity of on a regular basis language.
The educational curve is sort of small as properly and a few references to the official documentation will get you up and operating rapidly. You actually solely want the primary 4 arguments as talked about above to get an output, and when you’ve been working with Pivot Tables, you already know what they’re.

