How do I fill half a cell in Excel with color?

How do I fill half a cell in Excel with color?

Midavalo

New Member

JoinedApr 23, 2007Messages7Office Version

  1. 365
Platform
  1. Windows

  • Sep 16, 2007
  • #1

Hi there,

Is it possible (if so, how) to divide a cell in two (diagonally) and color one half and leave the other half blank/white? Trying to create a calendar type thing and show one of the days as a half day, so shade/color half and leave the other blank.

Thanks,
Mike.

 

How do I fill half a cell in Excel with color?

Joe4

MrExcel MVP, Junior Admin

JoinedAug 1, 2002Messages66,227Office Version

  1. 365
Platform
  1. Windows

  • Sep 16, 2007
  • #2

I don't think that is possible.

What you can do is make the day actually two cells for each day. If you want to center the day number across it, highlight both cells and use Format | Cells | Alignment | Horizontal | Center Across Selection.

Then you can center your entry across both cells, but only color half of it.

 

K

Kundepuu

New Member

JoinedSep 29, 2004Messages46

  • Sep 16, 2007
  • #3

try to something like this
Draw triangel shape and adjust it to cell size fill that color you need and also insert textbox and align text inside it.

 

Solution

How do I fill half a cell in Excel with color?

Midavalo

New Member

JoinedApr 23, 2007Messages7Office Version

  1. 365
Platform
  1. Windows

  • Sep 17, 2007
  • #4

try to something like this
Draw triangel shape and adjust it to cell size fill that color you need and also insert textbox and align text inside it.

Click to expand...

Thank you for your replies. We ended up doing something similar to this - created a triangle jpg and put it in the cell.

Cheers

 

Fill colors in Excel 2010 and 2013 usually fill each cell with a single solid color, no matter how large the cell in question. To add two background colors to one cell, use the Two Colors fill effect to create a gradient.

Step 1: Format Cells

Select the cell you want to fill, right-click the cell and choose Format Cells.

Advertisement

Video of the Day

How do I fill half a cell in Excel with color?

Image Credit: Image courtesy of Microsoft

Step 2: Open Fill Effects

Open the Fill tab and click Fill Effects.

Advertisement

How do I fill half a cell in Excel with color?

You can't combine a two-color effect with a pattern, so leave the Pattern Style blank.

Image Credit: Image courtesy of Microsoft

Step 3: Pick the Two Colors

Choose Two Colors, and then pick the two colors you want to use with the Color 1 and Color 2 selectors.

Here is how to put two colors into a cell. This does not allow you to create two cells from one information wise. You create the appearance of two pieces of information though using font formatting and spacing.

  1. Right click on the the cell(s)
  2. Select "Format cells"
  3. Click on "Fill" tab
  4. Click on "Fill Effects ..." (below color grid and above "Sample")
  5. Select the two colors you desire
  6. Select "Diagonal Up" or "Diagonal Down" under "Shading Styles"
However this produces blending of the two colors. To remove the blending you can use vba.

Here is how I accomplished it with VBA

Code:

Sub Macro1()
'
' Macro1 Macro
'
    With Selection.Interior
        .Pattern = xlPatternLinearGradient
        .Gradient.Degree = 90
        .Gradient.ColorStops.Clear
    End With
    With Selection.Interior.Gradient.ColorStops.Add(0)
        .ThemeColor = xlThemeColorDark1
        .TintAndShade = 0
    End With
    With Selection.Interior.Gradient.ColorStops.Add(1)
        .ThemeColor = xlThemeColorAccent1
        .TintAndShade = 0
    End With
End Sub


If you want to get rid of the blending add 2 ColorStops to the code like this. Note how the color now switches between 49% and 51% of the cell. I also removed the .TintAndShade lines as they are not important.

Code:

Sub Macro1()
'
' Macro1 Macro
'
    With Selection.Interior
        .Pattern = xlPatternLinearGradient
        .Gradient.Degree = 90
        .Gradient.ColorStops.Clear
    End With
    With Selection.Interior.Gradient.ColorStops.Add(0)
        .ThemeColor = xlThemeColorDark1 'First Color
    End With
    With Selection.Interior.Gradient.ColorStops.Add(0.49)
        .ThemeColor = xlThemeColorDark1 'First Color
    End With
    With Selection.Interior.Gradient.ColorStops.Add(0.51)
        .ThemeColor = xlThemeColorAccent1 'Second Color
    End With
    With Selection.Interior.Gradient.ColorStops.Add(1)
        .ThemeColor = xlThemeColorAccent1 'Second Color
    End With
End Sub


A couple of final notes.
  1. If you are looking for a diagonal or vertical color separation simply change the .Gradient.Degree to the appropriate angle.
    1. 0 = Vertical
    2. 45= rising diagonal
    3. 135 = falling diagonal
  2. Try .Color instead of .ThemeColor with a line of code like this
    1. .Color = RGB(255, 206, 0)
    2. This makes it easy to get whatever color you want all you need are the RGB integer values. Look them up on line or using excel under the More Colors> Custom colors section.

 

Can you fill a cell in Excel with 2 colors?

Click Home > Format Cells dialog launcher, or press Ctrl+Shift+F. On the Fill tab, under Background Color, pick the color you want. To use a pattern with two colors, pick a color in the Pattern Color box, and then pick a pattern in the Pattern Style box.

How do I half a cell in Excel?

Split cells.
In the table, click the cell that you want to split..
Click the Layout tab..
In the Merge group, click Split Cells..
In the Split Cells dialog, select the number of columns and rows that you want and then click OK..

How do I format only part of a cell in Excel?

Format Part of a Cell.
Select the cell you want to format..
In the formula bar, select the text you want to format..
Select the text formatting you want to use..
Press Enter..