In our daily life, we often feel the necessity to create **Excel scatter plots **in Microsoft **Excel**. We can do the job in many ways. In this article, we will see **3 suitable ways** to create **Excel scatter plot color by group**.

**Table of Contents**hide

## Download Practice Workbook

You can download the** Excel workbook** from here.

## 3 Suitable Ways to Create Excel Scatter Plot Color by Group

We can create **Excel scatter plot by group** in three suitable ways. These three ways consist of creating Excel scatter plot color by group** without conditions**, creating Excel scatter plot color by group **with conditions,**Â and by using **VBA Code**. In this article, we will see these three ways to create** Excel scatter plot by group**.

### 1. Create Excel Scatter Plot Color by Group without Condition

We can simply create** Excel scatter plot color by group** without condition. In order to do so, we will need a dataset like a picture below. We will create three groups (**A, B, and C**) using the **Number of Students** and their **Obtained Marks**. Now we will create an **Excel scatter plot**.

**Steps:**

- First of all, click on the
**InsertÂ**tab. - Then click on the
**Scatter Plot**dropdown option. - After that, choose the following
**Scatter plot**option like the picture below.

- As a result, it will open an empty plot like the following picture.

- Subsequently, right-click on the empty plot.
- Now, click on the
**Select Data Source**option from the pop-up window.

- After that, the
**Select****Data Source**window will pop up. - Now, click on the
**Add**option like the picture below.

- Next, type the Series name as
**Group A**. - After that, click on the
**Select Range**from the**Series X values**option.

- Subsequently, select the range of the number of student values from
**Group A**and complete the range.

- After that, click on the
**Select Range**in the**Series Y values**option like the picture below.

- Furthermore, select the range of obtained marks from
**Group A**and complete the range.

- After selecting the
**X**and**Y**values, click**OK**.

- As a result, it will create a plot of a particular color for
**Group A**like below.

- Subsequently, do the same for
**Group B**and**Group C**values with their range of data. - Then click
**OK**.

- Finally, it will create an
**Excel scatter plot**with different colors for different groups like the picture below.

**Read More: ****How to Make a Scatter Plot in Excel with Multiple Data Sets**

**Similar Readings**

**How to Connect Dots in Scatter Plot in Excel (with Easy Steps)****Add Multiple Series Labels in Scatter Plot in Excel****How to Make a Correlation Scatter Plot in Excel (2 Quick Methods)****Combine Two Scatter Plots in Excel (Step by Step Analysis)****Use Scatter Chart in Excel to Find Relationships between Two Data Series**

### 2. Apply Condition to Make Excel Scatter Plot Color by Group

Sometimes we need to make** Excel scatter plot** applying conditions. In order to do so, we will see an example. For the example, we will need a dataset like the below image. The dataset contains the **Number of Students** and their **Obtained Marks**.

**The Conditions** we will use are given in the picture below.

Now to create **Excel scatter plot**Â with conditions, we need to apply the following steps.

**Steps:**

- First,
**create**a new column named**Group A**. - Next, click on the
**D5**cell and type the formula:

`=IF(B5>C5,C5,NA())`

- Now press
**Enter**. - Then click on the
**D5**cell and drag the**Fill Handle**from cell**D5**to**D14**.

- Subsequently,
**create**a new column named**Group B**. - Next, click on the
**E5**cell and type the formula:

`=IF(B5<C5,C5,NA())`

- After that, press
**Enter**. - Then click on the
**E5**cell and drag the**Fill Handle**from cell**E5**to**E14Â**cell.

- Furthermore,
**create**a new column named**Group C**. - Then click on the
**F5**cell and type the formula:

`=IF(B5=C5,C5,NA())`

- Next, press
**Enter**. - Then click on the
**F5**cell and drag the**Fill Handle**from**F5**to**F14Â**cell.

- Now the table is ready to be plotted in the
**scatter plot**.

- At first, click on the
**InsertÂ**option. - Then, click on the
**Scatter Plot**downfall option. - After that, choose the following
**Scatterplot**option like the picture below.

- As a result, it will open an empty plot like the following picture.

- Subsequently, right-click on the empty plot.
- Now click on the
**Select Data Source**option from the pop-up window.

- Then
**Select Data Source**window will pop up. - After that, click on the
**Chart Data Range**option and select**$B$5:$B$14**and**$D$5:$F$14**pressing**ctrl**. - Next, click
**OK**.

- Finally, it will create an
**Excel scatter plot**for the three groups by individual colors like the picture below.

**Read More: ****How to Create a Scatter Plot in Excel with 3 Variables (with Easy Steps)**

### 3. Group Scatter Plot by Color Using VBA Code

We can also create **Excel scatter plot color by group** using **VBA Code**.Â It is helpful for those who prefer coding approaches to solving real-life problems. Now we will see an example of how to create an **Excel scatter plot**Â using **VBA Code**. In order to solve the example, we will need a dataset like the below image.

**Steps:**

- At first, right-click on the
**worksheet**at the lowermost part of your screen. - As a result, It will open a pop-up window and click on the
**View Code**option like the picture.

- Now
**Microsoft Visual Basic for Applications**window will open. - Then, type the following code:

```
Option Explicit
Sub Scatter_Points_Coloring()
Dim crt As Chart
Dim ser As Series
Dim pnt As Point
Dim m As Long
Dim val$, mTrim#, nTrim#
Dim vRange As range, pl As range
Dim pointColor As Long
Set crt = ActiveSheet.ChartObjects(1).Chart
Set ser = crt.SeriesCollection(1)
mTrim = InStrRev(ser.Formula, ",", InStrRev(ser.Formula, ",") - 1, vbBinaryCompare) + 1
nTrim = InStrRev(ser.Formula, ",")
val = Mid(ser.Formula, mTrim, nTrim - mTrim)
Set vRange = range(val)
For m = 1 To ser.Points.Count
Set pnt = ser.Points(m)
Set pl = vRange(m).Offset(0, 1)
With pnt.Format.Fill
.Visible = msoTrue
Select Case LCase(pl)
Case "red"
pointColor = RGB(255, 0, 0)
Case "orange"
pointColor = RGB(255, 192, 0)
Case "green"
pointColor = RGB(0, 255, 0)
End Select
.ForeColor.RGB = pointColor
End With
Next
End Sub
```

- Now run the code and close the window to see the results.

- Finally, it will create an
**Excel scatter plot**Â according to your preference and show an output like the below figure.

**Read More: ****How to Make a Scatter Plot in Excel with Two Sets of Data (in Easy Steps)**

## Things to Remember

- Excel scatter plot color by group
**without condition**is the**simplest way**to make an Excel scatter plot color by group. - If you want to make an Excel scatter plot
**using conditions**, then the Excel scatter plot color by group with condition is the best way to perform the job. - If you prefer
**coding applications**to solve real-life problems, then the**VBA Code**approach will be a better option for you.

## Conclusion

Hence, follow the above-described methods. Thus, you can easily learn how to create an **Excel scatter plot color by group**. Hope this will be helpful. Follow the **ExcelDemy **website for more articles like this. Donâ€™t forget to drop your comments, suggestions, or queries in the comment section below.

**Related Articles**

**How to Create a Scatter Plot with 4 variables in Excel (with Quick Steps)****Create a Scatter Plot in Excel with 2 Variables****How to Add Horizontal Line in Excel Scatter Plot (2 Quick Methods)****Add Text to Scatter Plot in Excel (2 Easy Ways)****How to Add Data Labels to Scatter Plot in Excel (2 Easy Ways)****Add Line to Scatter Plot in Excel (3 Practical Examples)****How to Add Average Line to Scatter Plot in Excel (3 Ways)**