The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

Counting lots of stuff in Excel 2010

ElJeffeElJeffe Registered User, ClubPA regular
Okay, I have two columns I'm interested in. One has a zip code, one has either the text string "violent" or "non-violent". What I want is a tally of, for each zip code, how many times each string appears. So something like:

ZIP NON-VIOLENT VIOLENT
95608 37 42
95609 120 64

...and so on.

There are about 2500 rows per worksheet, and I'm going to have 12 worksheets, so counting manually is right out. I know I can sort by zip code, then manually hunt to the end of each run of a given zip and do a countif to count the Vs and NVs, but this is clunky (there are about 50 different zip codes per worksheet) and it seems like there should be a better way. I'd prefer not having to write any VB code, because I haven't done that in forever and don't feel like relearning the process. Anyone know of a good means of doing this with operators and/or clever sorts or anything?

I submitted an entry to Lego Ideas, and if 10,000 people support me, it'll be turned into an actual Lego set!If you'd like to see and support my submission, follow this link.

Posts

  • MyiagrosMyiagros Registered User regular
    I can probably help, I'm a bit lost on what you are trying to add up though. Is each zip a new one so column A would always be different and you want to know the NV and V value at the end of X number of zip codes?

    iRevert wrote: »
    Because if you're going to attempt to squeeze that big black monster into your slot you will need to be able to take at least 12 inches or else you're going to have a bad time...
    Steam: MyiagrosX27
  • DeebaserDeebaser on my way to work in a suit and a tie Ahhhh...come on fucking guyRegistered User regular
    edited February 2013
    Pivot tables.
    Also, you might want to consolidate the twelve tables into a single data table.

    Deebaser on
  • ElJeffeElJeffe Registered User, ClubPA regular
    edited February 2013
    @Miyagros

    If the table looked like this:

    95608 violent
    95608 violent
    95608 non-violent
    95810 violent
    95810 non-violent
    95810 violent
    95810 violent
    95821 violent
    95821 non-violent
    95823 violent

    ...then I would want to get data that looked like this:
    ZIP         VIOLENT      NON-VIOLENT
    95608          2                    1
    95810          3                    1
    95821          1                    1
    95823          1                    0
    

    I have considered merging the worksheets into one, and will do that if it saves time. I need to keep track of what came from where, but I can just throw another column in there to track the month. (The worksheets are broken up by month.)

    edit: Also, it looks like pivot tables will be a good way to do this. I'm futzing about with them right now, and hopefully I can figure out how to properly wrangle those numbers.

    ElJeffe on
    I submitted an entry to Lego Ideas, and if 10,000 people support me, it'll be turned into an actual Lego set!If you'd like to see and support my submission, follow this link.
  • DeebaserDeebaser on my way to work in a suit and a tie Ahhhh...come on fucking guyRegistered User regular
    That is still a job for pivot tables

    Click the Insert ribbon
    Click pivot table
    insert pivot table on a seperate sheet
    Drag zipcode to row label
    Drag the header for violent/nonviolent to "Column Labels" and "values"
    click on the column header in "values" and change the "Value Field Settings" to Count

  • Dr. FrenchensteinDr. Frenchenstein Registered User regular
    deebaser has got it.

    you could probably do it with subtotals too, but pivot tables are prettier.

  • ElJeffeElJeffe Registered User, ClubPA regular
    Got it! Thanks @Deebaser , you are my new forum best friend.

    I submitted an entry to Lego Ideas, and if 10,000 people support me, it'll be turned into an actual Lego set!If you'd like to see and support my submission, follow this link.
  • GonmunGonmun He keeps kickin' me in the dickRegistered User regular
    I use pivot tables on my monthly reports for order entry and it's a god send. As well, with the info you get from the table you can double-click on the specific amounts under each zip and it will give the break down of the cells for each on a separate tab. Really comes in handy.

    desc wrote: »
    ~ * swole patrol flying roundhouse kick top performer recognition: April 2014 * ~
    If you have a sec, check out my podcast: War and Beast Twitter Facebook
  • schussschuss Registered User regular
    I hate pivot tables in excel (because their implementation is really odd and finicky), but they're still incredi-awesome for shit like this.

  • NijaNija Registered User regular
    I agree with the Pivot Tables.

    I was doing something similar using Match and then Filtering out the N/A. Actually, I still do that. I need to update my spreadsheet. Thanks guys!

    Priest lvl 110 Warlock lvl 9x DK lvl 110 Paladin lvl 9x Rogue lvl 8x

    Steam Me
  • useless4useless4 Registered User regular
    It's funny - I get paid to play with excel all day. pivot tables are the most logical way to do this yet I have spent the last ten minutes without Excel trying to use tables and countif statements to make it all complicated and fun. Now I have to get to work to try out my stupid complicated way of doing it! (god I need a better hobby then excel)

  • schussschuss Registered User regular
    useless - get your hands on some Business intelligence tools (Cognos/Hyperion(Oracle)/etc.). It's like super-excel that does tons of neat stuff with data.

  • useless4useless4 Registered User regular
    Have cognos and use it quite a bit just waiting for them to turn an instance on where i really need it :(

Sign In or Register to comment.