+ Reply to Thread
Results 1 to 6 of 6

Help to Create a Macro that will sort by name and count non-numeric values

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    3

    Help to Create a Macro that will sort by name and count non-numeric values

    Hi Everyone,

    I can't seem to figure out how to create a macro that will go through a list of names in column A and then count the number of deficiencies they had. Example:

    Name Def 1 Def 2 Def 3
    John Smith Missing Name Missing ID Missing ID
    Sally Jones Missing Form Missing ID Missing Name
    Peter Top Missing Form Missing Name Missing ID
    John Smith Missing Name Missing ID Missing ID
    Sally Jones Missing ID Missing Name Missing Name

    Output:
    John Smith Missing Name 2
    Missing ID 4

    Sally Jones Missing Name 3
    Missing Form 1
    Missing ID 2

    Peter Top Missing Form 1
    Missing Name 1
    Missing ID 1


    There are like 50 different deficiencies I need to count and sort. So ideally I don't want to have to hard code each deficiency in the code, but if that the only way, I'll gladly do it. I tried using countifs, but I'm having trouble getting it to work.

    Any help is greatly appreciated.

    Thanks
    Last edited by acamm9; 06-21-2012 at 11:23 AM. Reason: table not clear

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Help to Create a Macro that will sort by name and count non-numeric values

    acamm9,

    Welcome to the forum!
    Give this a try:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    06-21-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Help to Create a Macro that will sort by name and count non-numeric values

    Wow! You're my hero!

    I am getting #NAME? error for the count:

    Name Deficiency Count
    John Smith Missing ID #NAME?
    John Smith Missing Name #NAME?
    etc.

  4. #4
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Help to Create a Macro that will sort by name and count non-numeric values

    Oh, that's because you don't have excel 2007, and I was using a 2007 formula to get the count. Change the '.formula = ' line to be this instead:
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    06-21-2012
    Location
    Toronto
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Help to Create a Macro that will sort by name and count non-numeric values

    Beautiful! It works perfectly. When I grow up I want to be just like tigeravatar. Thanks so much, I really appreciate it.

  6. #6
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Help to Create a Macro that will sort by name and count non-numeric values

    You're very welcome

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1