A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Hi @Darren Yong
Excel formulas cannot directly copy a cell’s fill color. However, you can reproduce the same result by applying matching Conditional Formatting rules to Columns G and B.
Column H already contains the results of the COUNTIF formula and is conditionally formatted according to the count:
- 2 = red
- 3 = yellow
- 4 = green
- 5 or more = blue
To make Column G match Column H, select G3:G38, then go to:
Home > Conditional Formatting > New Rule > Use a formula to determine which cells to format
Create the following rules and apply the same fill colors used in Column H:
- Red: =$H3=2
- Yellow: =$H3=3
- Green: =$H3=4
- Blue: =$H3>=5
Set the Applies to range for each rule to: =$G$3:$G$38
Next, to make Column B match the corresponding colors in Column G, select B3:B100 and create these formula-based Conditional Formatting rules:
- Red: =COUNTIF($B$3:$B$100,B3)=2
- Yellow: =COUNTIF($B$3:$B$100,B3)=3
- Green: =COUNTIF($B$3:$B$100,B3)=4
- Blue: =COUNTIF($B$3:$B$100,B3)>=5
Set the Applies to range for each rule to: =$B$3:$B$100
Please note that the existing red rule in Column H should be changed from Cell Value > 1 to Cell Value = 2. Otherwise, counts of 3, 4, and 5 also satisfy the >1 condition, which may cause overlapping formatting.
This setup will keep all three columns visually consistent:
- Column H is colored according to the count.
- Column G uses the corresponding count in Column H.
- Column B counts each repeated item and applies the same color.
Hopefully this helps resolve the issue. If anything is unclear or the issue persists, feel free to reply below.
If the answer is helpful, please click "Yes". If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in the forum documentation to enable e-mail notifications if you want to receive the related email notification for this thread.