Rainbow Fill Cell in Excel: Step-by-Step Guide
In this article
There is no single "rainbow fill" button in Excel, but you can create the effect in a cell in under a minute using either the standard Fill Color palette for a fixed multi-colour look or a gradient fill for a smooth blend of colours. The simplest method is conditional formatting with one rule per colour, which lets Excel colour the cell automatically based on its value or position. If you want a cell that literally shows several colours at once, conditional formatting works only on separate cells; for one cell you need a gradient, a stacked image, or a shape overlay.
The steps below cover Excel for Windows and Mac desktop. The same options exist in Excel for the web and on mobile, but the Fill Color and gradient controls are easier to reach on desktop.
What You'll Need
- Excel for Windows or Mac desktop (any current version), or Excel for the web.
- A saved workbook, so you can undo experiments without losing work.
- Optional: a conditional formatting rule plan, such as which values should turn which colour, if you want the fill to change automatically.
Step-by-Step
Method 1: A single colour fill from the standard palette
- Select the cell or range you want to colour. Click the cell, or drag across several cells.
- On the Home tab, find the Font group and click the Fill Color button (the paint bucket icon). Label positions can differ slightly by version and region.
- Pick a colour from the swatches. This fills the whole cell with that colour, not a rainbow. Repeat with different cells to build a row of different colours.
- To use a precise colour, open the Home tab, Font group, and click the arrow next to Fill Color, then choose More Colors and set a custom value on the Custom tab.
Method 2: A smooth gradient fill (the closest true rainbow in one cell)
- Select the cell you want to fill. Gradient fill in Excel applies to shapes and chart areas, so if you want a gradient inside a data cell, the reliable route is to insert a shape over the cell area or use a chart element.
- Go to Insert > Shapes and choose a Rectangle. Draw it over the cell, then right-click the shape and choose Format Shape to open the task pane.
- In the Format Shape pane, choose Fill, then Gradient fill.
- Set the Gradient stops. Each stop is a colour point along the gradient. Add stops and set colours from red through orange, yellow, green, blue and violet to build a rainbow blend.
- Adjust the Gradient direction and angle to run horizontally or diagonally, then set the shape's outline to No Outline and transparency so the cell content stays readable.
- Right-click the shape and choose Send to Back so any text or numbers stay visible on top.
Method 3: Conditional formatting for automatic rainbow rows
- Select the range you want to colour, for example A1:A20.
- On the Home tab, click Conditional Formatting, then New Rule.
- Choose Use a formula to determine which cells to format.
- Enter a formula that targets one value or position, for example =ROW()=1 for the first row, then click Format and pick a red fill.
- Repeat the rule for each additional colour, changing the formula so each rule hits a different cell or band. Each rule needs its own colour.
- Click OK, then use Conditional Formatting > Manage Rules to check the order and confirm each rule applies to the range you intended.
Method 4: A fast fill down for a repeating rainbow
- Fill the first few cells with the colours you want, for example six cells covering red, orange, yellow, green, blue and violet.
- Select those cells, then drag the fill handle (the small square at the bottom-right corner of the selection) down or across.
- Excel copies the formatting pattern when you drag, so the colours repeat in sequence.
- If the pattern does not repeat as expected, use Home > Fill > Series, or reapply the colour with the Format Painter instead.
Common Mistakes
- Expecting Fill Color to produce a gradient inside a cell. It sets one solid colour per cell; a gradient needs a shape, chart area or image fill.
- Forgetting that conditional formatting overrides manual fill. If a cell already has a colour and a rule also matches, the rule's format wins.
- Applying a rule to the wrong range. Always confirm the Applies to box in Manage Rules lists your intended cells.
- Making the rainbow fill so strong that the text becomes hard to read. Keep fills light or add bold text and borders.
- Covering a cell with a shape and then wondering why edits do not land in the cell. Click the cell itself or move the shape; shapes float above the grid.
- Printing in black and white. Colours vanish on a mono printer, so preview with Print Preview first.
Tips
- Use a light tint of each colour rather than the saturated swatch, so numbers and labels remain legible.
- Save custom colours by making a small swatch cell and copying its format with the Format Painter, which keeps the rainbow consistent across sheets.
- For long lists, conditional formatting beats manual fills because it keeps the colour pattern attached to the data when you sort or insert rows.
- To make a rainbow legend, fill a row of six cells in sequence and label each one, then copy that row into a separate legend area.
- If you only want a coloured header row, apply the fill once to row 1 and lock the header with Home > Freeze Panes.
Troubleshooting
- The colour will not change. A conditional formatting rule or a cell style may be taking precedence. Open Conditional Formatting > Manage Rules and check whether a rule covers that cell, then clear the rule or reorder it.
- A gradient shape will not line up. Turn off snap to grid or hold Alt while dragging to position the shape precisely, then resize with the corner handles.
- Text disappears behind the shape. Right-click the shape and choose Send to Back, or set the fill transparency higher.
- The fill disappeared after pasting. Pasting values without formatting drops the fill. Use Paste Special and choose Formats or Keep Source Formatting.
- Only one rule seems to apply. Overlapping rules conflict; use Stop If True on the first matching rule, or rewrite formulas so each rule targets distinct cells.
- File looks wrong on another machine. Colours shade differently on some displays and in some Excel versions. Test on the target machine before sharing.
Frequently Asked Questions
Can a single Excel cell contain multiple colours at once?
Not through Fill Color, which sets one solid colour per cell. A multi-colour look inside one cell requires a gradient shape overlay, a picture fill, or a chart element placed over the cell.
Does Excel have a built-in rainbow colour scale?
Yes, as a conditional formatting option. Go to Home > Conditional Formatting > Color Scales and choose one. These scales blend from one colour to another based on value, but they apply across a range rather than producing a literal six-colour rainbow in one cell.
Why did my rainbow fill disappear after I sorted the data?
Manual cell fills move with the cells when you sort, so the colours can appear out of order. Conditional formatting rules tied to formulas stay with the rows and keep the pattern consistent.
Can I copy a rainbow fill to another sheet?
Yes. Copy the formatted cells, switch sheets, and use Paste Special > Formats, or drag a copy of the sheet with formatting intact.
Will the colours print correctly?
Only if you print in colour and your printer supports it. Light tints separate better on paper than saturated colours, and dark fills can use a lot of ink.
Can I apply a rainbow fill to an entire row automatically?
Yes, with a conditional formatting formula that references the row or a helper column, applied to the full row range. Each colour needs its own rule and formula.