Hi - I'm trying to use pivot tables to check the integrity of some data. I've figured out a quasi-automatic way to do it, but I need help figuring out how to fully automate the process.
A simple example of the types of pivot tables I work with is below (sorry, I couldn't figure out how to show the table borders, so I used underlines instead-hopefully you can see them OK). The right-most column is one I added next to the pivot table to illustrate which rows I want to keep and which ones I want to hide/delete. In a perfect world, every entry in my master data file for a particular state would have the same region (eg, both entries from Arkansas reflect the Midwest as the region). Unfortunately, sometimes the State and Region don't match, illustrated by the fact that my pivot table has two entries for Connecticut - one with the Region set to Atlantic and one with the Region set to New England. Does anyone know how I could exclude or hide entries like Arkansas & California and only show entries like Connecticut? The actual files I'm working with have thousands of entries in the first column (it's actually customer accounts, not States), so deleting/hiding the rows that are OK is really useful before sending the questionable rows to the sales force so they can figure out if the "State" entry is wrong or if the "Region" is wrong - or if they should be different for some reason.
<table border="0" cellpadding="0" cellspacing="0" width="305"><tbody><tr style="height: 12.75pt;" height="17"><td class="xl24" style="height: 12.75pt; width: 68pt;" height="17" width="90">Count of State</td> <td class="xl25" style="width: 62pt;" width="83">
</td> <td class="xl29" style="width: 26pt;" width="35">
</td> <td class="xl29" style="border-left: medium none; width: 73pt;" width="97">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">State</td> <td class="xl24">Region</td> <td class="xl29" align="center">Total</td> <td class="xl33" style="border-left: medium none;">Desired Action:</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Arkansas</td> <td class="xl24">Midwest</td> <td class="xl29" align="center">2</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">California</td> <td class="xl24">Pacific</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Connecticut</td> <td class="xl24">Atlantic</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">KEEP</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl26" style="height: 12.75pt;" height="17">
</td> <td class="xl27">New England</td> <td class="xl30" align="center">1</td> <td class="xl34" style="border-left: medium none;">KEEP</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Florida</td> <td class="xl24">Southeast</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Georgia</td> <td class="xl24">Midwest</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">KEEP</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl26" style="height: 12.75pt;" height="17">
</td> <td class="xl27">Southeast</td> <td class="xl30" align="center">1</td> <td class="xl34" style="border-left: medium none;">KEEP</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Hawaii</td> <td class="xl24">Pacific</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Illinois</td> <td class="xl24">Midwest</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Montana</td> <td class="xl24">West</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">New York</td> <td class="xl24">Atlantic</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Pennsylvania</td> <td class="xl24">Atlantic</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl28" style="height: 12.75pt;" height="17">Grand Total</td> <td class="xl32">
</td> <td class="xl31" align="center">13</td> <td class="xl31" style="border-left: medium none;">
</td> </tr> </tbody></table>
The quasi-automatic work-around requires copying the entire pivot table using if/then statements to set rows like Arkansas to blanks, adding a new column that copies row headings like Connecticut into all of the Connecticut-related rows, and then running a new pivot table based on this new list of data. Unfortunately, this process is proving to be too cumbersome to teach to everyone who needs to scrub data files like this.
Finally, if you don't know how to answer my question but have suggestions for what phrases to use when I search forums, I'd appreciate those suggestions too. "Hide rows in pivot tables" isn't specific enough.
Oh, and I'm also happy to take suggestions on how to post a copy of a pivot table into the forum - I saw them posted in other threads, but couldn't figure out how to do that either.
A simple example of the types of pivot tables I work with is below (sorry, I couldn't figure out how to show the table borders, so I used underlines instead-hopefully you can see them OK). The right-most column is one I added next to the pivot table to illustrate which rows I want to keep and which ones I want to hide/delete. In a perfect world, every entry in my master data file for a particular state would have the same region (eg, both entries from Arkansas reflect the Midwest as the region). Unfortunately, sometimes the State and Region don't match, illustrated by the fact that my pivot table has two entries for Connecticut - one with the Region set to Atlantic and one with the Region set to New England. Does anyone know how I could exclude or hide entries like Arkansas & California and only show entries like Connecticut? The actual files I'm working with have thousands of entries in the first column (it's actually customer accounts, not States), so deleting/hiding the rows that are OK is really useful before sending the questionable rows to the sales force so they can figure out if the "State" entry is wrong or if the "Region" is wrong - or if they should be different for some reason.
<table border="0" cellpadding="0" cellspacing="0" width="305"><tbody><tr style="height: 12.75pt;" height="17"><td class="xl24" style="height: 12.75pt; width: 68pt;" height="17" width="90">Count of State</td> <td class="xl25" style="width: 62pt;" width="83">
</td> <td class="xl29" style="width: 26pt;" width="35">
</td> <td class="xl29" style="border-left: medium none; width: 73pt;" width="97">
</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">State</td> <td class="xl24">Region</td> <td class="xl29" align="center">Total</td> <td class="xl33" style="border-left: medium none;">Desired Action:</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Arkansas</td> <td class="xl24">Midwest</td> <td class="xl29" align="center">2</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">California</td> <td class="xl24">Pacific</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Connecticut</td> <td class="xl24">Atlantic</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">KEEP</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl26" style="height: 12.75pt;" height="17">
</td> <td class="xl27">New England</td> <td class="xl30" align="center">1</td> <td class="xl34" style="border-left: medium none;">KEEP</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Florida</td> <td class="xl24">Southeast</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Georgia</td> <td class="xl24">Midwest</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">KEEP</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl26" style="height: 12.75pt;" height="17">
</td> <td class="xl27">Southeast</td> <td class="xl30" align="center">1</td> <td class="xl34" style="border-left: medium none;">KEEP</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Hawaii</td> <td class="xl24">Pacific</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Illinois</td> <td class="xl24">Midwest</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Montana</td> <td class="xl24">West</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">New York</td> <td class="xl24">Atlantic</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl24" style="height: 12.75pt;" height="17">Pennsylvania</td> <td class="xl24">Atlantic</td> <td class="xl29" align="center">1</td> <td class="xl33" style="border-left: medium none;">hide or delete</td> </tr> <tr style="height: 12.75pt;" height="17"> <td class="xl28" style="height: 12.75pt;" height="17">Grand Total</td> <td class="xl32">
</td> <td class="xl31" align="center">13</td> <td class="xl31" style="border-left: medium none;">
</td> </tr> </tbody></table>
The quasi-automatic work-around requires copying the entire pivot table using if/then statements to set rows like Arkansas to blanks, adding a new column that copies row headings like Connecticut into all of the Connecticut-related rows, and then running a new pivot table based on this new list of data. Unfortunately, this process is proving to be too cumbersome to teach to everyone who needs to scrub data files like this.
Finally, if you don't know how to answer my question but have suggestions for what phrases to use when I search forums, I'd appreciate those suggestions too. "Hide rows in pivot tables" isn't specific enough.
Oh, and I'm also happy to take suggestions on how to post a copy of a pivot table into the forum - I saw them posted in other threads, but couldn't figure out how to do that either.