Table of Contents
Introduction: Coloring Bubble Charts in Excel
It is frequently necessary when performing advanced data visualization in Microsoft Excel to visually differentiate data points within a bubble chart based on a specific value or category. Standard two-dimensional charts often limit visual insight, but the bubble chart adds complexity by integrating three variables: X-axis, Y-axis, and Size (Z-value). However, to unlock the full analytical potential of such a visualization, we often need a fourth dimension—Color—to represent a categorical variable. This technique is indispensable for comparing groups, identifying clusters, and highlighting variations within a large dataset, ensuring the final plot is both informative and highly engaging, much like the sophisticated example displayed below, where color clearly distinguishes the categories.
While this capability might seem complex, requiring sophisticated programming or specialized statistical software, the good news is that Excel provides a straightforward, albeit slightly unconventional, method to achieve this goal. This method bypasses the limitations of the standard chart series setup by strategically restructuring the input data. By defining each category (e.g., Team Name, Region, Product Type) as its own separate data series, Excel’s native charting engine automatically assigns a unique color palette to each group, effectively coloring the bubbles based on their associated value.
This detailed guide will walk you through the precise, step-by-step process required to format your data and generate a compelling bubble chart where the color attribute is dynamically driven by a categorical variable. We will demonstrate this technique using a realistic sports dataset, illustrating how to transform raw data into a powerful visual tool for analytical insight. The subsequent steps focus on data manipulation and the ingenious application of conditional formulas, which are the core mechanisms enabling this advanced visualization within the Excel environment.

Understanding the Need for Categorical Coloring
A traditional bubble chart is powerful because it allows three variables (X, Y, Size) to be plotted simultaneously. However, if the underlying data contains categorical variables—such as departments, regions, or in our example, basketball teams—visual separation becomes critical for comparative analysis. If all bubbles share the same color, interpreting performance trends across different groups is virtually impossible. Coloring by value transforms the plot from a simple display of three variables into a rich, four-dimensional analysis tool, enabling users to quickly identify performance clusters or outliers associated with specific categories.
The challenge arises because Excel’s charting functionality typically links a single data series to one color assignment. To color bubbles based on a categorical variable (like Team Name), we must trick Excel into treating each unique category within that variable as its own distinct data series. This ingenious workaround requires preprocessing the data before chart insertion. Instead of plotting a single series containing all teams, we will create multiple parallel series—one for Team A, one for Team B, and so forth—ensuring that only the relevant data points appear in each series, while nullifying the others.
This restructuring process is the most crucial part of the procedure, demanding careful attention to formula construction, specifically the use of the IF function combined with the NA() function. By correctly isolating the data points belonging to each category, we ensure that when the chart is drawn, Excel recognizes these separate streams of data and automatically applies distinct colors, effectively achieving the desired categorical visualization without manual color assignment.
Step 1: Preparing and Inputting the Initial Dataset
The initial stage involves gathering and organizing the raw data into a clean, columnar format within an Excel worksheet. For this demonstration, we are utilizing a dataset focused on basketball statistics, which tracks individual player metrics across multiple teams. The columns must clearly define the categorical variable (which will dictate the color) and the three quantitative variables (X, Y, and Size) that define the bubble position and scale. Our specific data structure includes: Player Name, Team Name (the category for color), Points (X-value), Assists (Y-value), and Years in the League (Size/Z-value).
Ensure that the data is entered precisely, starting typically in the A1 cell region, allowing for clear headers. The quality of the final visualization relies entirely on the accuracy and completeness of this initial input. We are setting up the foundation for a powerful comparison:

Our primary goal is to generate a bubble chart where the horizontal axis represents Points, the vertical axis represents Assists, and the size of the bubble reflects Years in the League. Most importantly, the color must correspond to the Team Name. This initial data arrangement is standard; the necessary complexity begins in the next step, where we restructure this information to meet Excel’s specific charting requirements for multi-series plots.
Step 2: Restructuring Data for Categorical Plotting (The Key Technique)
Before generating the chart, the raw data must be restructured to accommodate separate data series for each unique team. This is the lynchpin of the entire process. Start by identifying all unique values within your categorical column (Team Name in this case). List these unique team names horizontally across a new row above your main data block, beginning in an empty column (e.g., cell F1, G1, H1, etc.). Below each team name header, we will create two corresponding columns: one for the X-value (Points) and one for the Y-value (Assists).
This arrangement creates dedicated slots for the quantitative data associated with each team. For example, Team A will have two new columns (Points A, Assists A), Team B will have two (Points B, Assists B), and so on. This structure ensures that when we select the data for charting, Excel recognizes five distinct data series: one initial series for the Z-values (Years) and four subsequent pairs of X/Y series, each corresponding to a unique team color.
The image below illustrates this setup. We have created four unique team headers (Teams 1 through 4) starting in cell F1, with corresponding X and Y value columns underneath, ready for the conditional formulas:

Detailed Breakdown of the Conditional Formula
The core of the restructuring relies on conditional logic to populate these new columns. The goal is simple: if a player belongs to the team listed in the header row, we insert their X or Y value; otherwise, we insert an error value that Excel knows how to ignore when plotting charts. This ensures that only relevant data points are plotted in each individual team series. The formula leverages the IF function, which tests a condition and returns one value if true and another if false.
We use the special NA() function (Not Available) as the value to return if the condition is false. The crucial benefit of using NA() is that Excel charts will automatically ignore cells containing this value, preventing gaps or erroneous zero values from skewing the visualization. If we used 0 instead of NA(), players not belonging to a team would plot at the origin (0,0), corrupting the chart.
Begin by typing the following formulas into cells F3 and G3, respectively. Note the critical use of absolute and relative cell referencing (the dollar signs) to ensure the formula drags correctly across and down the matrix:
- F3: =IF($A3=F$1, $C3, NA())
- G3: =IF($A3=F$1, $D3, NA())
In the F3 formula, we are testing if the Team Name in cell $A3 (the categorical variable, locked to column A) matches the team header in cell F$1 (locked to row 1). If the condition is true, the player’s Points ($C3) are returned; otherwise, NA() is returned. The G3 formula follows the same logic but returns the Assists ($D3).
After entering the formulas, highlight cells F3 and G3. First, click and drag the formulas horizontally to the right until you reach the column corresponding to the final team’s Y-value (in this example, cell K3). This step applies the conditional logic across all team columns. Next, with the entire row F3:K3 still highlighted, click and drag the formulas downwards until they cover all player data rows (in this example, cell K11). This action populates the entire restructuring matrix, resulting in a dataset where columns F through K contain data points clustered exclusively by team, with all other cells marked as Not Available.

Step 3: Generating the Multi-Series Bubble Chart
With the data meticulously prepared in the previous steps, we are now ready to insert the bubble chart. The selection process must be precise, as we need to select the Z-value data (Years) first, followed by all the newly constructed X/Y pairs corresponding to the team categories. The selection must be performed carefully using the Ctrl key to select non-contiguous ranges, a technique fundamental to advanced Excel charting.
First, highlight the range containing the Z-values (Years), which is B3:B11 in our example. This range will define the size of all bubbles. Then, crucially, press and hold the Ctrl key. While holding Ctrl, highlight the entire restructured matrix containing the conditional data, which is the range F3:K11. This selection method groups the data correctly, ensuring that the years column is the initial input defining the size, followed by the segregated team data defining the points and assists.

Once the ranges are correctly selected, navigate to the top ribbon. Click the Insert tab. Within the Charts group, locate and click the option for Bubble chart, typically found under the scatter plot section. Selecting the bubble chart type prompts Excel to generate the visualization based on the multi-series data input.

Step 4: Interpreting the Initial Output
Upon successful execution of Step 3, the resulting bubble chart will immediately appear on your worksheet. The most significant feature of this output is that each group of bubbles corresponding to a unique team is automatically assigned a different color. This is because, through the data restructuring using the NA() function and the conditional IF function, Excel recognized four distinct data series (Team 1, Team 2, Team 3, Team 4), each requiring its own default formatting.
The visualization clearly plots Points on the X-axis and Assists on the Y-axis. Furthermore, the size of each bubble correctly corresponds to the Years in the League variable, establishing the three quantitative dimensions. By utilizing the color as the fourth dimension, we have successfully created a powerful visual display where performance attributes can be instantly compared across different teams.

The chart demonstrates that the careful preparation of the dataset, specifically isolating the X and Y coordinates for each category, is the technical key to achieving categorical coloring in Excel’s charting environment. Each player is represented, and their team affiliation dictates the bubble’s hue, allowing for easy visual segmentation and analysis of the data.
Step 5: Enhancing the Visual Appearance (Optional Customizations)
While the chart generated in Step 4 is functionally complete, it often requires aesthetic refinement to meet professional presentation standards. This optional, yet highly recommended, final stage involves modifying the visual elements to improve clarity, readability, and overall impact. Customization options are extensive in Excel and include adjustments to colors, bubble sizes, axis labels, titles, and overall chart styling.
Customizations typically involve right-clicking on chart elements to access the Format Pane. You may choose to manually refine the colors assigned to each team series to align with corporate or presentation themes. Additionally, enhancing axis labels (adding titles for Points and Assists) and ensuring the legend clearly identifies the colored categories are crucial steps. You might also adjust the scaling of the bubble size to ensure appropriate visual distinction among the data points, preventing overlap or illegibility.
The goal of customization is to ensure the final output effectively communicates the data insights without distraction. By adding polish and clarity, the bubble chart transforms from a technical output into a professional visualization tool, capable of supporting informed decision-making. The following image represents a fully customized version, demonstrating the potential for enhanced aesthetics and improved data communication:

Conclusion: Benefits of Value-Based Charting
Mastering the technique of coloring a bubble chart by value in Excel represents a significant step toward creating highly analytical and visually effective reports. While Excel does not offer a direct one-click solution for coloring by category, the strategic manipulation of the underlying dataset using conditional logic—specifically the combination of the IF function and the NA() function—provides a reliable and powerful workaround. This method successfully transforms the categorical variable into multiple distinct data series, allowing Excel to automatically assign unique colors.
This approach is highly transferable across various datasets and applications. Whether you are analyzing sales figures by region, tracking project efficiency by department, or evaluating demographic data by category, the fundamental principle remains the same: segment the X and Y variables based on the category using conditional logic, ensuring non-members are replaced with NA() values. This technique ensures that complex, multidimensional data visualizations can be generated using standard Excel tools, enhancing interpretability and analytical depth.
By following these structured steps, users can confidently generate sophisticated visualizations that clearly communicate relationships between three quantitative variables while simultaneously providing immediate insight into categorical affiliations, offering a distinct competitive advantage in data presentation and analysis.
Cite this article
stats writer (2025). How to color a bubble chart by value in Excel?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-to-color-a-bubble-chart-by-value-in-excel/
stats writer. "How to color a bubble chart by value in Excel?." PSYCHOLOGICAL SCALES, 18 Nov. 2025, https://scales.arabpsychology.com/stats/how-to-color-a-bubble-chart-by-value-in-excel/.
stats writer. "How to color a bubble chart by value in Excel?." PSYCHOLOGICAL SCALES, 2025. https://scales.arabpsychology.com/stats/how-to-color-a-bubble-chart-by-value-in-excel/.
stats writer (2025) 'How to color a bubble chart by value in Excel?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-to-color-a-bubble-chart-by-value-in-excel/.
[1] stats writer, "How to color a bubble chart by value in Excel?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, November, 2025.
stats writer. How to color a bubble chart by value in Excel?. PSYCHOLOGICAL SCALES. 2025;vol(issue):pages.
