Marketers know that typically 80% of sales come from just 20% of customers, and by focusing on that group, you can gain valuable insights into your data. With the help of Excel, it’s easy to determine not only who your top 80% of customers are, but also how much revenue they’re actually bringing in. In the example below, we’re going to go over how to do such an analysis, and identify how much your top 20% and bottom 20% of customers generate.
And you can also do further analysis by looking at the top 10% or whatever cutoff points you want. In this example, we’ll create a spreadsheet which will allow you to set these different cutoff points however you want.
This is the data set that I’m going to use for this example.
Step 1: Convert the data into a pivot table
The first thing we’ll want to do is to convert this into a pivot table. By doing this, we can sum up the totals by individual customers. We don’t want to apply the analysis on raw numbers as that will only give us the top invoices when instead, we’re looking at sales by customers.
If you select a cell on the data and go to the Insert tab, you can click on the button to create a Pivot Table. Then, pull the sales data into the fields section and the customer field into the Rows section. This now creates a summary by customer.
Step 2: Calculate the cutoff points
Now that the data is grouped by customer, we can start to calculate the sales by different percentiles. If you want to determine the top 20%, then we need to get the 80% percentile. At that level, the values will be higher than 80% of the rest of the data, and thus, leave us with the cutoff for the remainder, the top 20%.
With the sales data in column B, we can use the following formula to get this cutoff point:
=PERCENTILE(B:B,0.8)
The 0.8 indicates the 80% percentile, which means that the value returned is higher than 80% of the values in the data set. In my data set, this returns a value of 276.34. Any customer whose total is at or above this cutoff point means that they are part of the top 20%.
To get the cutoff value for the bottom 20%, the same formula is used, except now for the second argument, the value is set to 0.2. This returns a value of 101.90. In this situation, we’ll be focusing on values at or below this cutoff.
Step 3: Calculate the sales that fall within the top and bottom 20%
Now, let’s calculate the total dollar amount of the sales that fall in the top and bottom 20% ranges. For the top 20%, we’ll need to sum up all the values that are equal to or greater than that cutoff point of 276.34. With that value in cell B3, my formula is as follows:
=SUMIF($B$9:$B$1000,”>=”&$B3)
The pivot table sales field is in column B. This calculation returns a value of $35,072. That is the total dollars that my top 20% of customers have generated.
To calculate the bottom 20%, we can use the following formula, assuming that the cutoff point for 101.90 is in cell B4:
=SUMIF($B$9:$B$1000,”<=”&$B4)
The total of this value is 7,894, and that indicates how much revenue the bottom 20% have brought in.
We can visualize these data points by plotting them on a column chart:
If you want to calculate different percentiles and cutoff points, you just need to adjust the second argument in the percentile formula.
If you liked this post on How to Do an 80/20 Sales Analysis in Excel, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.
In this post, I’m going to walk you through the steps of creating a dashboard in Excel, from start to finish. You can use the sample data file to follow along with my example, which is not based on any real information but it represents a realistic data set. Here is an overview of it:
We’ll first start with preparing the data by creating pivot tables, then turning those pivot tables into charts, formatting the charts, and linking the relevant pivot tables together using slicers. We’ll also add some data that isn’t connect to any pivot tables but which can summarize the overall data set.
Step 1: Plan your dashboard and the key metrics you want to track
An important step in any dashboard creation is first thinking what data you want to track. This is crucial because if you can’t think of at least four metrics you want to plot on charts, then you may not have enough relevant data to create a useful dashboard. You may need to pull in more data. A dashboard that has just a few key data points is not going to be all that useful. For many users, the whole point of a dashboard is being able to easily stay on top various metrics and track trends and gain multiple insights in just a single page.
The sample data above has customer name, city, state, shoe model, category, size, and color. Those are a lot of useful metrics. Some easy metrics to track could include sales by date, by state, by category, and by model. That gives us a lot of things to track. You can add more but at the very minimum, you should be able to think of at least four charts you can create from your data set. Any less than that, and you might want to consider adding to your data set.
Step 2: Make sure your data is in a table
If you data isn’t already in a table, make sure to convert it into one. This is useful because when you create a table, you can setup an easy name to remember when creating your pivot tables. Rather than having to remember the sheet name and a specific range, you can just use a named range such as tblData.
To turn the data set into a table, click anywhere on your data and use the CTRL+T shortcut. Excel should automatically detect your range. If it doesn’t, make sure to adjust it. And then once it is correct, click on OK and you can set your table name in the top-left-hand corner, by simply typing tblData.
Another benefit of using a table is that if you add to your data set over time, you don’t have to worry about adjusting the range you’re referencing. If you use tblData as your range when creating your pivot table, you can confidently know that it will include new rows added to your data set (as long as there are no gaps).
Step 3: Create multiple pivot tables
I create a pivot table for every chart I want to track on a dashboard. This makes it easy to ensure everything is pulling from the same data source. To create a pivot table quickly, you can use the ALT+N+V+T shortcut. I prefer to put all the pivot tables on a separate sheet, which I’ll call the PT tab in this example.
Setup each pivot table with the metrics you want to track (e.g. shoe model in rows, sales in the values section). Repeat this for each metric you want to show on your dashboard.
Here are the pivot tables I’ve setup:
PivotTable 1: Rows: Shoe Model; Values: Sales
PivotTable 2: Rows: Category; Values: Sales
PivotTable 3: Rows: State; Values: Sales
PivotTable 4: Rows: Date; Values: Sales
PRO Tip: create one pivot table, then copy and paste it multiple times. Afterwards, adjust your fields. There is no need to go back to the data set each time and create a new one.
Step 4: Customize your pivot tables (optional)
For Pivot Tables 3 and 4, I’m going to make some additional adjustments. Since there are 50 possible states that can appear in my pivot table, this is not going to be useful to display on a chart; it will get very cluttered. Instead, what I will do is display the top 10 states.
To do this, select the drop-down option for the State field and choose Value Filters and Top 10.
By leaving the default selection, it will leave the top 10 items by sales. We can also sort the data from largest to smallest, by right-clicking on any of the items and selecting Sort and Sort Largest to Smallest
This now shows us the top 10 states, sorted from largest to smallest in terms of sales.
Next, for Pivot Table 4, which contains dates, we need to setup the correct grouping, as it may simply show the ungrouped dates. This may not be the case in your version of Excel, and that will ultimately depend on your settings.
To group this, right-click on any of the dates and select Group, where you’ll see the following options for grouping your dates:
Let’s select months and years for the grouping. This avoids the potential issue of including multiple months together, which can be problematic if you have multiple years (e.g. you don’t want January 2025 and January 2024 being added together).
Now, we have a more organized data set by year and month.
But let’s also show current monthly values as well as cumulative values. To do this, simply drag the sales field a second time into the values section. The data will look identical, but if you select the drop-down arrow for the field, you can select Value Field Settings which will allow you to change how the data is displayed.
In the Show Values As tab, there will be an option to show values as Running Total In. There, you can select Months (Order Date). We can also rename the field to say Cumulative Sales:
This now gives us multiple views for the sales data: a monthly view, as well as a cumulative view. You’ll notice since it is based on month, the cumulative values don’t reset and continue adding on.
Step 5: Format your value fields
Before moving on to the next step, now is a good time to adjust the different field settings for all your pivot tables, to ensure the values are formatted properly as numbers. This will make them easy to display on your dashboard. By going into each of the different fields in your value section and selecting Value Field Settings, you can adjust the Number Formatting. Let’s set the format to Currency and remove any decimal places, to minimize the space the values take up, while also making it clearing they are dollars (you can also adjust the symbol to your local currency):
Repeat these steps for all of your different value fields in your pivot tables.
Step 6: Create the charts
With the pivot tables setup, the next step is to actually start creating the different charts. Here again, you’ll want to consider planning out your charts as well. You don’t want to create a boring dashboard which just has the same column or bar charts over and over again.
For the pivot table which shows dates, let’s use a combination that displays both column charts and line charts. To set this up, ensure you select Combo when choosing a chart type.
This creates the following chart:
To clean this chart up, I’m going to remove the drop-down options and also the legend for values. For the latter, just select the legend and click the delete button. And to turn off the drop-down buttons, go into the PivotChart Analyze tab and press the Field Buttons option so it no longer shows that it is pressed:
This now creates a cleaner look for the chart:
One optional change you may want to consider is to shrink the gap width to minimize the white space in the chart. By right-clicking on the chart and selecting Format Data Series, you’ll see an option to modify the gap width.
By changing the gap width to 100%, this makes the columns wider:
At this stage, it’s just a matter of customizing the chart to how you want it to look and feel. The changes I’ve applied are as follows:
Setting the columns to a green fill color.
Setting the line chart to grey with black data points.
Adding vertical lines to the chart.
Setting the plot area to a grey color.
Adding a border to the plot area.
This results in the following chart:
The next chart to create is for sales by category. For this one, let’s create a pie chart. The 3D pie chart in particular, looks like a good option for this pivot table:
Let’s remove the legend and the field buttons again with this template. However, without legends, it’s hard to read and understand this chart. To get around this, let’s add labels. This can be done by clicking on any of the pie chart slices and selecting Add Data Labels. You can then right-click on any of the labels and select Format Data Labels where you can specify to include both the value and the Category Name. This, unfortunately is still a bit difficult to read:
To make this easier to read, right-click on any of data labels and select Change Data Label Shapes and select the rounded rectangle.
After shrinking the font for the labels, it’s now easy to see them:
Let’s also make the following changes:
Sort the pivot table so that the values in arranged from highest to lowest. This is helpful in reading a pie chart by seeing the largest values first.
Adjust the colors of the pie chart so that they are more gradual. On the Design tab, let’s adjust the colors so that they are different shades of blue.
Now, here is my finished 3D pie chart:
Next, let’s create a chart for the top 10 states. This one will be a simple, clustered bar chart. Here is how it initially looks:
For this chart, I’ll make the following changes:
Reduce the gap width for the bar charts to 50%.
Change the color to purple.
Add data labels.
Lastly, I’ll setup the chart to show sales by shoe model. This will be just a simple clustered column chart that will be set orange:
PRO TIP: If you want to expedite the process of setting up your charts, you can select your chart and on the Design tab select a pre-defined style to apply to your dashboard. You can still make adjustments afterwards, but this can give you a good starting point.
Step 7: Add totals and headers
In addition to creating pivot charts, let’s also incorporate metrics, such as total sales and items sold. We can position these metrics above the main charts and slightly below the header. For now, let’s just refer to this as ‘Sales Dashboard’ for the sake of keeping it simple.
Let’s also merge cells and create a title for the metrics. One will be called ‘total sales’ and another will be ‘items sold’. This can be helpful to always show these totals, regardless of which filters are applied to pivot tables. Let’s also create a grey background color for these items to allow them to stand out more easily.
To generate these totals, all we need to do is sum up the sales from the main data table, which will be used for the Total Sales metric. And for the total items sold, we’ll need to total the quantity field from the data sheet.
With these metrics, these numbers will not change even if the pivot table values change. This can be useful to just get a quick snapshot of everything that’s important.
Step 8: Add slicers and a timeline
To make this dashboard dynamic, it’s important to also add slicers. By doing this, someone can quickly apply multiple filters to all the pivot tables at once. To add slicers, select any of the pivot tables and click on the Insert tab and click Slicer. This will give you a list of all the fields which you can add as slicers:
These are the fields to add which may be ideal for this dashboard:
Category
Color
Shoe Model
Size
State
Let’s add all that slicers on the left-hand-side of the page, with the exception of the state slicer, which can go across the top. For that slicer, since there are so many different options, we can select the slicer and change the number of columns to 5.
This now produces a slicer that’s easier to scroll through:
For fields where the items are short in length, setting up multiple columns can be ideal in this situation.
Since we have a date field, we can also add a timeline to this dashboard. Similar to adding slicers, select any pivot table, and on the insert tab, select the Timeline button.
There is only one date field to select. Choose that and click OK, which will add the timeline.
At this stage a key part is to organize your slicers in a way that’s easy to read the options and scroll through them all. You can also apply custom formatting to all of them. In my example, I’ve applied a green color to the slicers. Here is how they are organized:
Step 9: Link slicers and timelines to all pivot tables
You might think you’re done after the last step, but and important thing to do is to link all your slicers to all your pivot tables. This is key to ensure that all your charts updated based on a slicer or timeline selection. To do this, go through your slicers and the timeline created, and right click on them to select Report Connections. Upon doing so, you’ll see a list of all the different pivot tables that you can link to. Check them all off.
If you do this for all of the slicers and timelines you’ve setup, clicking any one of them will now link to all of your charts. Now, any slicers you select will impact all of the charts on your dashboard.
Step 10: Personalize your dashboard with a logo
You can structure your dashboard in a way that your slicers intersect in the top-left-hand corner, which can leave a space for a logo. This can allow you to easily insert an image for a company’s logo. You can go to the Insert tab and select Place Over Cells and This Device, if you want to select an item from your computer.
I’ve inserted my logo, which ties in well the green theme of my slicers.
You can also follow this video tutorial to help walk you through the process of creating this dashboard.
If you liked this post on How to Create a Dashboard in Excel to Summarize Sales Data, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.
Charts can be an effective way to convey data, as opposed to just tables. By visualizing numbers, readers can easily see the highs and lows, and just how much of a variance exists between them. In this example, I’m going to show you how to turn a table summarizing S&P 500 sector performance into a chart.
The data we’re going to use for this example is as follows:
Let’s turn this into a more helpful visual, which will sort these values from highest to lowest. Here are the steps you can take to do that:
1. Sort the list from largest to smallest
This can be done by simply selecting the 2024 return header and clicking on the sort descending button. The table is now re-arranged as follows:
2. Create a column chart
By selecting the data and choosing to create a column chart, you can create a visual that now displays the returns, from highest to lowest.
3. Select a chart style
If you select the chart and click on the Chart Design tab, there will be many different styles to choose from. This can save you the time from making multiple adjustments yourself.
Let’s select the dark one on the bottom-left corner.
4. Remove gaps
To make the column chart more snug, you can remove the gaps between them. To do this, right-click on the chart and select Format Data Series. Adjust the Gap Width to 0%.
5. Remove axis labels
Since we’re going to incorporate the labels into the actual chart, you can remove the axis labels themselves. To do this, simply click on each axis and click on the delete key. You’ll now have a chart that looks like this:
6. Setup the color formatting for the column charts
To help display the largest and worst-performing sectors, let’s apply different colors to each column. Starting with the first column chart, set that to a dark green color and apply a black border around it. Then, proceed to the next one, by clicking on ctrl + right arrow. This avoids having to manually select each item. If you need to go back in the opposite direction, you can use ctrl + left arrow.
Here’s how I’ve setup my chart so it gradually goes from a dark green to a lighter green, to light red, and dark red.
7. Add labels
If you right-click on any of the columns, there will be an option to Add Data Labels. Once added, you can also right-click on them to select Format Data Labels. Let’s select the option to show the value along with the category name, and set the label position to Center.
What we can also do is setup a data label shape, so that it’s easy to see. To do this, right-click on any of the labels and select Change Data Label Shapes. Let’s choose a rounded rectangle.
Next, on the alignment section, let’s also set the text direction to rotate all text 270 degrees.
This now results in the following chart:
8. Add a title
The last step is simply to update the title, to more accurately reflect the data. Let’s rename it by double-clicking on the title, and setting the name to ‘Sector returns in 2024’
If you liked this post on How to Analyze S&P 500 Sector Performance Using an Excel Bar Chart, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.
Creating a pivot table is not difficult to do. If you just go to the Insert menu in Excel, there is an option to select a Pivot Table. As long as you have your data selected, Excel goes to work and creates the table. But making a good pivot table is an entirely different story. And that’s the real challenge — making your pivot table easy to read and understand, and not cumbersome to update. To help you with that process, here, I’ll list 10 of the most common mistakes you can make when creating a pivot table, and how you can avoid them!
1. Not cleaning your data beforehand
The old adage of “garbage in, garbage out” is true when it comes to data analysis, and pivot tables are no exception. If you have data that has incorrect values, then there’s no sense in creating a report on it. Take the time to check and review your formulas, make sure you don’t have any blank or missing values (or at least keep them to a minimum), and also check for spelling inconsistencies. That last one can be an easy one to miss. If you have a value with an extra space, that won’t be the same as a value without one.
If you spend the time of cleaning up and reviewing your data before you create a pivot table, you’ll save yourself some headaches and possible embarrassment later on; no one wants to provide their boss with a report that is incorrect.
2. Forgetting to use an Excel table
To convert your data into a table is easy — just use the CTRL+T shortcut. By doing so, you’ll ensure that your table will automatically expand and your formulas will copy down as you add new entries and rows. And as long as you pivot table references your table, then you won’t have to worry about re-adjusting the range later on. Otherwise, if you’re referencing a static range, the danger is that you forget to include new data as you add on to it. And in that situation, your report may once again be incorrect.
3. Not refreshing after data changes
Even if you’re using a table, you still need to ensure that your pivot table is refreshed. Unless you have a macro setup, this is a process you’ll need to do manually. By right-clicking on your pivot table and clicking Refresh, your data will update. You can also go to the Data tab and select Refresh from there.
Alternatively, if you right-click and select Pivot Table Options, under the Data tab, you can choose to Refresh data when opening the file, which will do a refresh when first opening the file.
4. Using merged cells in source data
Merged cells can cause lots of issues in Excel, including with pivot tables as that can cause problems when grouping your data. If you have merged cells, that can also mean that values are missing from certain fields. Merged cells should generally be avoided in Excel, and even if you want to spread a title across multiple cells, as you might with a header, there’s an easy way to look as though you’re merging a value without actually merging the cells.
5. Dragging text fields into the values area
If your pivot table looks like this, where you have a count of values when you’re expecting to see a summation or an average, it’s likely that you’ve put a text value in the values section:
This happens because Excel doesn’t know what to do with these values since it can’t add them. In the above example, a text field (category) has been placed in values section and upon doing so, Excel simply does a count of them. To fix this, ensure that you are correctly organizing your pivot table and not putting any text fields into the values section.
6. Not renaming field labels
When creating a pivot table, you might be tempted to leave the default names when setting it up. However, that can lead to unnecessarily long titles such as Count of Category or Sum of Sales.
You can fix this by selecting the arrow next to the pivot table field and clicking on Value Field Settings:
You might be frustrated that you can’t change the name to the same label. If I were to change the field to simply say ‘Sales’ then I would get an error stating that it’s already in use since that is the source name. However, an easy workaround is to just add an extra space. By renaming it to ‘Sales ‘ it no longer triggers an error and in the pivot table, it will look as though I’ve used the same name as the source. It also saves space and can make your field names more meaningful; there’s no reason you have to use the defaults.
7. Using Inconsistent Date Formats
If your dates are not entered as dates, and some are reading as text, or perhaps are entered as day/month/year rather than month/day/year, this can be another problem, because it can mean your data isn’t being grouped correctly.
This can be a harder issue to catch and that’s where doing a spot check of your pivot table after it has been created is helpful. You can clean your data beforehand, but errors like this are more difficult to spot. This is why it’s always a good idea to review your pivot table, and make sure it makes sense. If you have sales in a future month, for example, that can be an easy way to spot that you have a possible problem with your dates.
8. Repeating the same layout changes over and over again
When you first setup a pivot table, the default layout may not be what you want. But instead of making the same changes over and over again, why not simply save them as your new default? Once you’ve made the changes that you want, such as repeating labels and/or displaying the pivot table in a tabular format, you can save your pivot table layout as a default. This can be done by going to File-> Options -> Data and selecting Edit Default Layout for your pivot table.
You can import the layout by just selecting the pivot table you’ve modified and clicking on the Import button.
9. Making changes to individual cells rather than fields
One frustrating and easy-to-make mistake is to format pivot tables the way you might regular tables and other data in Excel. You might be tempted to select an entire column and change the formatting to how you want it. The problem? Once your pivot table refreshes, the data reverts back to its previous form. This is happening because you aren’t adjusting the underlying field settings.
To adjust the actual field, select it from your pivot table layout and go into Value Field Settings. Once there, go into the Number Format option and make any formatting changes there.
Now once you make the changes, they will remain intact, even after you update your pivot table.
10. Overcomplicating the Layout
As easy mistake to make with a pivot table is by cluttering it up with too many fields. In the below example, I have too many fields listed in the Rows section, and they’re in an order which isn’t logical, going from category->size->color->shoe model.
This doesn’t make the pivot table easy to read and understand. I have almost recreated the original table by setting it up this way. A good mix involves putting some fields in the rows section and some in the columns. And a good rule of thumb to follow is to use the fields which contain the most number of items in the rows section, rather than columns. This is because it’s a lot easier to scroll up and down with a mouse wheel versus horizontally and having to drag the scroll bar.
If you liked this post on 10 Pivot Table Mistakes to Avoid, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on X and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.
When it comes to working with Excel, mastering the various built-in functions can save you time, increase your efficiency, and unlock new ways to analyze your data. One such function, often underutilized but incredibly powerful, is the CHOOSE function, which is available in Excel 2016 and newer versions. In this guide, I’ll explain what the CHOOSE function does, how to use it, and provide you with practical, real-world examples to help you become an Excel power user.
What is the CHOOSE Function in Excel?
The CHOOSE function in Excel allows you to select a value from a list of options based on a given index number. It’s like a simplified version of a lookup function: you specify a number, and Excel returns the corresponding value from a set of choices you provide.
Why Use the CHOOSE Function?
Quickly pick from a list of options without complicated formulas.
Useful for creating drop-down dependent formulas, simple scenarios, or mock data.
Combines well with other functions to create flexible, dynamic formulas.
CHOOSE Function Syntax
The syntax of the CHOOSE function is as follows:
=CHOOSE(index_num, value1, [value2], …)
index_num: The position number in the list of values you want to return. This must be a number between 1 and 254.
value1, value2, …: The possible choices (up to 254 in total).
Example:
=CHOOSE(2, “Red”, “Blue”, “Green”)
Result: Blue
Explanation: The index number is 2, so Excel picks the second value, which is “Blue”.
Basic Examples of the CHOOSE Function
Let’s start with some simple use cases to help you understand how CHOOSE works.
Example 1: Picking a Day of the Week
Suppose you have a number between 1 and 7 and want to return the corresponding weekday.
If cell A1 contains 1, the formula returns “Sun”
Example 2: Creating a Simple Menu
You want to return a meal based on a number.
Practical Uses for CHOOSE in Excel
Now that you’ve seen the basics, let’s explore how the CHOOSE function can help you solve real-world Excel problems.
1. Simulating a VLOOKUP with CHOOSE
Although VLOOKUP is often used to look up values, you can use CHOOSE to create a two-way lookup, especially for dynamic scenarios.
Example: Dynamic Lookup Table
Suppose you have sales data for two years in columns:
You want to pick which year’s sales to show based on a cell (say, cell D1: 1 for 2024, 2 for 2025).
Formula in cell D2:
=CHOOSE($D$1, B2, C2)
If D1 = 1, you see sales for 2024.
If D1 = 2, you see sales for 2025.
2. Generating Random Items from a List
Combine CHOOSE with the RANDBETWEEN function to randomly pick an item.
Each time you recalculate, Excel picks one fruit at random.
3. Creating Conditional Labels
Suppose you have a grading system:
MATCH returns a number 1-5, which CHOOSE uses to assign “F”, “D”, “C”, “B”, or “A”.
4. Working with Dates
Pick the correct month, quarter, or label based on a number.
Combining CHOOSE with Other Functions
The true power of CHOOSE comes when you combine it with other functions for advanced scenarios.
Example: Dynamic Chart Series
You have two data series and want to switch which series your chart displays using a dropdown (Data Validation).
Set up your options in a cell (1 = Sales, 2 = Profits).
Use CHOOSE to dynamically reference your data:
=CHOOSE($B$1, SalesRange, ProfitsRange)
Where SalesRange and ProfitsRange are named ranges.
Example: Returning Ranges
You can return entire ranges with CHOOSE (useful in array formulas or dynamic charts).
=SUM(CHOOSE(2, B2:B10, C2:C10, D2:D10))
Returns the sum of column C.
Common Errors and Troubleshooting
1. #VALUE! Error
Reason: The index number (index_num) is less than 1 or greater than the number of choices.
Solution: Check that your index number is within the valid range.
2. #REF! Error
Reason: You are trying to reference a range outside of what is available (for example, referencing a column that doesn’t exist).
Solution: Double-check your value references.
3. Non-integer Index
Reason: Index number is not an integer.
Solution: Ensure the index is a whole number.
CHOOSE vs. INDEX vs. SWITCH: Which to Use?
CHOOSE: Best for a small, fixed list of options, or when returning ranges or arrays.
INDEX: Better for large lists, dynamic lookups, or when referencing ranges based on a row/column number.
SWITCH: Great for exact matching of values.
Example:
Use CHOOSE when you want =CHOOSE(2, “Apple”, “Banana”, “Cherry”) for simple selection.
Use INDEX when you have a table and want =INDEX(A2:A100, 5).
Use SWITCH for matching exact values: =SWITCH(A1, “A”, 1, “B”, 2, “C”, 3, “Other”).
Frequently Asked Questions
Q: Can CHOOSE be used with arrays? A: Yes, you can use CHOOSE in array formulas, especially to select between ranges for dynamic charts or calculations.
Q: What is the maximum number of choices in CHOOSE? A: Up to 254 values can be specified.
Q: Can CHOOSE be used with text, numbers, ranges, and formulas? A: Yes, you can use CHOOSE to return text, numbers, cell references, ranges, or even calculations.
The CHOOSE function in Excel is a versatile, easy-to-use tool that can simplify many tasks, from random selections to dynamic reporting. While it may not replace more advanced lookup functions in every situation, it shines when you need to pick from a small set of options or return specific ranges dynamically.
By mastering CHOOSE, you add another valuable skill to your Excel toolkit, helping you work smarter and faster.
If you liked this post on How to Use the CHOOSE Function in Excel: A Comprehensive Guide, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.
If you’ve ever worked with dynamic arrays in Excel, you’ve probably come across the #SPILL! error. This error message may seem confusing at first, but it’s actually Excel’s way of telling you that there’s a problem with how it’s trying to display an array of results.
In this post, I’ll walk you through:
What causes the #SPILL! error
Common reasons you might see it
How to fix and prevent it
What Is the #SPILL! Error?
The #SPILL! error appears when a formula is trying to return multiple results, but Excel can’t display them all in the cells below or beside the formula. This happens when using dynamic array functions such as:
FILTER()
SORT()
SEQUENCE()
UNIQUE()
Or any formula that returns more than one value
For example:
=SEQUENCE(5)
This function is supposed to generate a column with 5 numbers (1 to 5). But if something is blocking the spill range, Excel will return a #SPILL! error instead. Consider the following example:
As you can see from the above image, there is a dashed line over the area that the formula wants to fill in. And one of those cells, A6, contains a value, which prevents the formula from entering a value there.
Common Reasons for #SPILL! Errors
Here are the most frequent causes for why you may encounter a #SPILL! error in Excel:
1. Blocked Spill Range
There’s data in one or more of the cells where the array wants to go. As in the example above, the formula can’t overwrite a value that’s already in a cell, and thus, it returns an error.
How to fix: You can clear the cell(s) which are in the way of the array formula. Or, you can move your formula somewhere else in your file where it will have the room it needs for the results.
2. Merged Cells
Another issue that can arise is that even if one cell in the spill area is merged, Excel can’t write the array output.
How to fix: You can either move your formula somewhere else, or else you’ll need to unmerge. To unmerge the cells in the spill range, first select them, and then follow these steps: Home > Merge & Center > Unmerge Cells
3. Spill Range Goes Off the Sheet
If the array result is too large and extends beyond the edge of the worksheet, you’ll also get this error. In this case, you’ve probably made a mistake in your formula where you are returning too many rows or columns. In this situation, it’s probably a good thing that you’re getting an error, otherwise, you may end up with much more data than you anticipated, and that could slow down your spreadsheet.
How to fix: Check if the result would go beyond column XFD or row 1,048,576. If so, reduce the size of your formula.
If you liked this post on How to Fix #SPILL! Errors in Excel, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.
The default pivot table layout can oftentimes be suboptimal. The compact view doesn’t make it easy for analyzing data, especially when you have many fields. If you’re like me, one of the first things you probably do after creating a pivot table is to change the layout so it’s easier to view the data. The good news is you don’t have to keep repeating those steps. You can change the default so that when you create a pivot table, it’ll already have your desired settings applied. In this post, I’ll show you how to do that.
Here’s a sample pivot table, which shows you sales broken out by city, state, customer, and in this case, the type of product (shoe) sold:
There are many things which are suboptimal here, including the following:
The compact format has put the customer, city, and state fields all in the same column.
There are many subtotals, which create repeating values in this data set and are unnecessary.
To start, I’ll make these changes manually and then save those options as my default.
To turn off subtotals, I can go into the Design tab (the pivot table has to be selected for this to be visible) and under Subtotals, select the option to not show subtotals:
To change the layout from compact, I’ll stay in the Design tab and select Report Layout and choose Show in Tabular Form.
This now produces the following pivot table:
This, however, is still not ideal as the state values only appear once. Instead, I’d like to see the value repeating so that every line has every field filled in. This makes it ideal if you want to use any formulas that reference the pivot table. Back in the Report Layout section, there is an option to select Repeat All Item Labels. Upon doing this, now my pivot table is filled in for all possible fields:
This is how I prefer to setup my pivot table. But rather than having to repeat the process each time, I can save these settings.
How to save your preferred pivot table layout as the default
To save your preferred layout (after setting it up), go into the File tab and select Options at the bottom, which will open up the Excel Options. And if you navigate to the Data section, you will see the first option relates to the default layout of Pivot Tables — click the button to Edit Default Layout.
Next, you’ll find all the different options you can specify for your pivot table:
You can specify these different settings for subtotals, grand totals, and labels. Or, what you can also do is import the layout. To do this, simply click on a cell in your pivot table, and then click on the Import button. In my example, cell P14 contains my pivot table:
After clicking the Import button, the settings are automatically applied and updated:
As you can see, it has applied the changes for me, without having to make the changes manually from the different boxes and drop downs. This can be helpful if you’ve already setup a pivot table the way you want, rather than determining which different settings you want to apply. When you click on OK, now your settings will be applied.
The next time you create a pivot table, these saved settings will be in place and you won’t have to change them again. These settings are saved to your computer and even if you open a new Excel file and create a new pivot table, they will take effect.
If you liked this post on How to Change the Default Layout of Your Pivot Table in Excel, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.
PIVOTBY is a relatively new function that Excel introduced in 2021. It is a dynamic, formula-based alternative to pivot tables. It’s part of Excel’s push toward more dynamic, flexible data analysis, especially for users who prefer formulas over the drag-and-drop interface of traditional PivotTables. In this article, I’ll walk you through what PIVOTBY does, how to use it, and provide some examples to help you master it.
What Does the PIVOTBY Function Do?
PIVOTBY summarizes data based on one or more grouping columns and returns an array with calculated values—similar to a pivot table, but directly inside a formula.
It allows you to group data by categories (like region, product, or date) and then apply an aggregation function (like SUM, AVERAGE, COUNT, etc.) on another column. Here are the main arguments for the function:
row_fields: this the range which will be used to group rows.
col_fields: this is the range which will group the columns.
values: this is a range for the data which is to be aggregated.
function: this determines how the data should be aggregate (e.g. SUM, AVERAGE, COUNT)
How the PIVOTBY Function Works
Here’s a sample data set that I am going to use to illustrate how the PIVOTBY function works:
In the above table, dates are in column A, the name is in column B, followed by store in column C, department in column D, and amount in column E. Assuming my data is in a table called tblData, I can use the following syntax to create a pivot table showing sales by name and store:
You can also pull in multiple columns or rows with the help of the CHOOSE function. Suppose you wanted to pull in both the name and the department a person is from. Here’s how you can accomplish that, while also removing totals:
The benefit of this setup is that since this is a spill function, it will automatically update and populate the data and no refresh is necessary. There are, however, downsides to consider:
If there is not enough space for the pivot table, you will encounter a #SPILL! error.
Unlike a conventional pivot table, you can’t drill down to see the details
This won’t work on versions of Excel prior to 2021.
If you just want an easy way to summarize your data without the need for drilling down, then the PIVOTBY function can work well and be a suitable replacement for a normal pivot table. For more of a comparison between the function your typical pivot table, check out this video:
If you liked this post on How to Use the PivotBy Function in Excel, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.
Creating a Pivot Table is one of the fastest ways to summarize large amounts of data in Excel. But if your data is spread across multiple sheets, it can seem a little overwhelming. The good news is: you don’t have to manually copy everything into one sheet. You can easily combine multiple sheets into a single Pivot Table.
In this Excel tutorial, I’ll walk you through how to make a Pivot Table from multiple sheets, step-by-step, with the help of Power Query. If you want to follow along, download the practice file here.
Loading the data into Power Query
You will need to have your data setup in tables in order to combine all of it. However, you can do that all at once. Go through each tab and select your data, and under the Data tab, click on the option to get data From Table/Range:
Excel will automatically detect your range. You can adjust if need be, otherwise, you just need to confirm whether it contains headers (which it should to avoid issues later on):
This now opens up Power Query, where your data is now visible:
On the Home tab, select the option for Close & Load and select Close & Load To and choose Only Create Connection.
This ensures the data is added into Power Query but it does not create a new tab. Repeat these steps for the other tabs.
If you forget to select the option to only create a connection, then you can just delete the tab that is created afterwards; the result is the same — only a connection will be created. After loading five tables in this practice file and creating the connections, you should see the following queries under the Queries & Connections pane on the right-hand side (this should automatically display when you first add a table to Power Query).
With the data loaded, now let’s go into Power Query by right-clicking on any of these connections and selecting Edit.
In Power Query, on the left-hand side, you can edit the table names so that you know what they relate to:
By right-clicking on the table names, you can change them. I’ve renamed them so that it is clear which regions they relate to:
Table1: Northwest
Table2: Northeast
Table3: Southwest
Table4: Southeast
Table5: Central
In each table, I’m also going to add a field called Region, where I will list the names of those tables. By going into the Add Column tab and selecting Custom Column, I can enter in the new column name as well as the value. This is the custom column I’m creating for the Northwest table:
After creating the column, this is what the updated table looks like:
Repeat these steps for the other tables, entering their specific regions for the Region field. In order to ensure the data is consolidated correctly, you’ll want to ensure that the field names are the same.
Appending the queries together
With all the data in Power Query, we can append the queries together, to create one large table. To do this, go to the Home tab and select the Append Queriesas New option, which will create an entirely new query:
Select the option to append three or more tables and select all of them and then click OK:
Now, all the tables are appended into one query:
Now, this appended table can be loaded into Excel. In this instance, you don’t want to create just a connection but instead download the entire table into Excel.
This table can now be used to create a Pivot Table as you normally would, through the Insert -> Pivot Table option. And now, when creating your pivot table, you’ll see the values from all regions combined. You can now slice the data based on region and month, and whatever other fields are in the data set.
If you enter more data and want to update your pivot table, what you first need to do is go to the Data tab and click on Refresh All. This will refresh your queries. You will also need to do another refresh to ensure that the pivot table updates after that. This can be done by just right-clicking on the pivot table and clicking refresh rather than doing Refresh All again, which will also update the queries and may be more time consuming.
If you liked this post on How to Make a Pivot Table From Multiple Sheets in Excel (Step-by-Step Guide), please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.
The TRIMMEAN function has been available on Excel since the 2016 version. What it does is return the mean (average) of your data set, but it excludes a portion of your data. This can be useful if you want to exclude outliers and data that may not be typical. Small and large numbers can sometimes skew a data set and while you could use the MEDIAN function to get the middle value, you may also prefer to just exclude the highest and lowest values.
It offers another way to calculate an average, which may be more representative than the MEDIAN. What you may want to consider is using the function alongside the MEDIAN and AVERAGE functions, to see just how much of a disparity there is in your data set.
How the TRIMMEAN function works
The TRIMMEAN function has just two required arguments: array and percent. The first argument is the array of numbers you want to calculate for the average. The second argument is where you specify the percentage of outliers you want to exclude. If you have 10 data points and enter 0.2 for 20%, that would eliminate 2 data points — 1 from the top and 1 from the bottom.
In the below example, I have a list of 10 random numbers between 1 and 100:
Using the AVERAGE function, it calculates a value of 32.9 as the average. But if I apply the TRIMMEAN function as specified above, where I exclude 20% of the values, then the value I get is 31.5. Here’s how that is calculated:
If you sort the data and exclude the largest and smallest number, the rest will average out to 31.5. If I were to change my percentage argument to 0.4 and 4 numbers are excluded, the top 2 and bottom 2 numbers will be excluded:
But what if the percentage you specify doesn’t result in an even number to remove from the top and bottom? For example, what if you want to exclude 30% of the numbers from a list of 10 values? In that case, the TRIMMEAN function still excludes just 2 numbers. Until it can remove an even number from both the top and the bottom, it won’t exclude any further numbers. Here’s how it calculates as you increase the percentage:
As you can see, the TRIMMEAN function doesn’t return a different amount until it gets to 40%, at which point it can remove an even numbers from the top and bottom of the range (2).
This is an important thing to keep in mind when using the function as it can result in an incorrect assumption that you are ignoring a certain percentage of numbers when really, it won’t be excluding that many unless you enter a high enough percentage where it can trim an equal number from the top and bottom of the range.
How does this compare against the MEDIAN calculation?
The big question is whether this TRIMMEAN function is still useful given the noted limitations. Here’s how it calculates versus the MEDIAN function, which simply takes the middle number (or averages the two middle values):
In this example, the TRIMMEAN function returns a lower value. However, if the values 47 and 48 and changed to 37 and 38, then the result would be as follows:
The MEDIAN function is the only one which returns the same value, since it is averaging the middle two values (30 and 35). However, both the AVERAGE and TRIMMEAN functions return lower values.
There is no right or wrong function to use but using all three can help you gain some insights into your data and how much variance there is in it.
If you liked this post on How to Use the TRIMMEAN Function in Excel, please give this site a like on Facebook and also be sure to check out some of the many templates that we have available for download. You can also follow me on Twitter and YouTube. Also, please consider buying me a coffee if you find my website helpful and would like to support it.