Share via

Modifying PivotTable Styles to include grouped gridlines

Anonymous
2011-01-20T17:22:24+00:00

Greetings!

An advanced PivotTable student of mine asked how to modify the style of a PivotTable Style to include gridlines around groups and subgroups all the way through to the values. We modified the PivotTable styles but haven’t been able to figure this one out. Thought I would see if I can stump the Microsoft experts here.

This is what we did (example file available)

  • Create a pivot table with multiple row headings
  • Set the Pivot table layout to Tabular
  • If you set the Pivot Table Style to NONE, the gridlines show up very nicely. Woohoo.. but there isn’t any color.
  • As soon as you pick another style (with color), the gridlines disappear, which is okay.
  • We tried modifying the colorful style to include gridlines but we can’t figure out which Pivot element needs the gridline settings. We’ve tried all combinations but to no avail.
  • The closest we got was to add Inside and outside gridlines to the Whole table and then Outside gridlines to the Row Subheadings. But that didn’t work.

It would be nice to just modify the "None" style or at least copy the "none" style which has the gridline format we want but those options aren't available.

Thoughts?

-Vickie

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

12 answers

Sort by: Most helpful
  1. Anonymous
    2015-07-15T19:08:42+00:00

    For what it's worth, and it sounds like you're trying to do what I just spent way-more-time-than-I-should-have-spent to figure this out, in Excel2010 on the Design Tab of the PivotTable Tools, in the PivotTable Style Options, just make sure all 4 (Row Headers, Column Headers, Banded Rows and Banded Columns) are checked. At least that's what got the auto-gridlines to show up for me in any of the Styles without having to add borders.

    Thanks,

    Matt

    One way to achieve a substantial part of the goal is to "cheat" and use conditional formatting within the pivot table.

    1. Click on the cell within the pivot table column you wish to format
    2. Select conditional Formatting (Home -> Conditional Formatting)
    3. Create a new rule
    4. Select the 2nd button within the Apply Rule To:  radio button group representing the pivot column you wish to format
    5. Select rule type "Use a formula to determine which cells to format"
    6. enter "=True" (without the quotes) for the formula. This is the trick that will force Excel to format every cell in the column regardless of the value
    7. Click on the "format" button and format as you see fit.
    8. press OK to save the change

    hope this helps.

    Eric

    Was this answer helpful?

    10+ people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2015-06-09T21:56:27+00:00

    For what it's worth, and it sounds like you're trying to do what I just spent way-more-time-than-I-should-have-spent to figure this out, in Excel2010 on the Design Tab of the PivotTable Tools, in the PivotTable Style Options, just make sure all 4 (Row Headers, Column Headers, Banded Rows and Banded Columns) are checked. At least that's what got the auto-gridlines to show up for me in any of the Styles without having to add borders.

    Thanks,

    Matt

    Was this answer helpful?

    10+ people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2016-01-16T22:17:58+00:00

    PivotTable Tools > Design tab > Report Tab > enable Show in Tabular Form.

    Was this answer helpful?

    9 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2017-12-15T17:11:01+00:00

    Easy Approach

    Something I did was use conditional formatting on the section or the entire page (might want to do entire page since pivot tables can expand contrast. This is what I did: 

    1. Pivot in Tabular format - As a general rule, I think Pivot Tables are best laid out in tabular format - Pivot Tables are sourced from tables, an I've found most people I've presented information to like seeing the Pivot's summary information in a similar way. To do this, go to the "Design" tab, at the far left, click on "Report Layout", then "Show in Tabular Format". For your purposes, you also want to select "Do not Repeat Item Labels" because the conditional formatting will basically look for blank cells.

    1. Create your own Pivot Table - From the Design Style selection, choose "New Pivot Table Style" and from the design menu, chose "Whole Table" and make it so the whole table has borders (I prefer only horizontal ones, myself). Change anything else you prefer for the look like giving the Header and Grand Total rows a different color, but leave it so that the middle is no fill/white
    2. Conditional format blank cells to have a white border - I selected all cells on the sheet, and made it so that any cells that were blank would have the TOP border white. What this does is make the row group look like a merged cell. Go to "Conditional Formating" on the Home tab, select "New Rule" then "Format only Cells that Contain", then make "Cell Value" "Equal to" then type in ' ="" ' (that's equal, quote quote - or basically equals blank). Then click on "Format", select the "Border" tab and then make it so the TOP border is White.

    This gets you roughly what you're looking for. Though it won't band your rows, it will give the effect of grouping them.

    More complicated approach

    To band them, you could make a formula that basically alternates the words in the first column between 1 and 2, and conditional format on the 2 such that any row that has a 2 will be filled a color. Here you Would want the rows to repeat in the tabular format. So in this case, if the first column has groups A, B, and C. If you sort it so that Group A all appear together, then they would get a 1, the next Group (B) would get a 2, and C would get a 1 again. This needs a pretty specific formula to make it work both to get the 1 and 2s, And for conditional formatting, so if you'd like just message me and I can walk you through it, but the easier approach should suffice as a quicker solution.

    Hope this helps,

    Daniel

    Was this answer helpful?

    8 people found this answer helpful.
    0 comments No comments
  5. Anonymous
    2017-11-01T03:58:05+00:00

    Right click on pivot table column, Field Settings, Layout and Print tab, insert blank line after each item label.  In a tabular pivot table view this helps visually groups the rows of a given subgroup.  This was the best way I could find to do this.

    Was this answer helpful?

    5 people found this answer helpful.
    0 comments No comments