Aug 18 2021 02:09 PM
Aug 18 2021 02:09 PM
I have a list of 1200 zip codes which I want to organize with a pivot table. I have reformatted the list as "text" and as "special (zip code)" multiple times, spot-checking to be sure all numbers are formatted the same way. No matter what I do, when I create the pivot table, SOME of the zips are read as if they are numbers. So I get duplicates of many of the zips, with separate counts, in the final pivot. (too many to fix by hand). I have copied and pasted the list of zips to a new worksheet; removed the pivot table and re-made it; refreshed multiple times; reformatted the list as "text" and as "special" (zip codes). Nothing works. Any suggestions?
Aug 18 2021 09:52 PM
@KM_Date Difficult to diagnose without seeing the ZIP codes. If they are just formatted as text it could be that the "duplicates" contain trailing spaces. For instance a ZIP code like "12345-1234" is NOT equal to "12345-1234 " and will be seen as two separate items. Or perhaps you copied them from a web-site. Then they could contain hidden characters with a similar effect as trailing spaces. Use TRIM and CLEAN functions to clean-up the data.
However, when these ZIP codes are recognised by Excel and can be custom formatted, e.g. as a US Zip code, the trailing spaces etc. should have no impact. Can you upload a file with just the list of1200 ZIP codes?
Aug 19 2021 07:49 AM
@Riny_van_Eekelen Thanks so much for your offer to help out. Here is the file. These were hand collected by merchants on a small town main street, and I entered the data myself from their hand-written sheets. The colored bands were used to check each column of zips as it was entered. As you can see the pivot is not doing what it is supposed to do; and the original table is all in text format. Any suggestions most appreciated!
Aug 19 2021 07:50 AM
Aug 19 2021 08:16 AM
Aug 19 2021 08:17 AM - edited Aug 19 2021 08:17 AMSolution
@KM_Date Sorry, now I see!
See attached. I copied your list and ran it through Text-to-columns and made Text of it all. Now in Column E and the pivot table beside it. I guess this is what you want.
Aug 19 2021 10:59 AM
Aug 19 2021 11:14 AM
@KM_Date If you format the column you intend to enter the ZIP codes in as Text before you manually enter the codes it should work. But entering a mix of numbers and text first and then format the column as text will not work. Excel merely left justifies what you entered, numbers and texts.
On the Data ribbon you'll find the icon for Text to columns. In step 3 of 3 you can indicate that you want to treat the data as text. That transforms all data a type of text. That's just the way it is.
And I'm afraid that the "data model" option is not for you as you indicated that you ar on a Mac.