+ Reply to Thread
Results 1 to 4 of 4

Thread: Row Count Help

  1. #1
    Registered User
    Join Date
    09-21-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Row Count Help

    Hello,

    I have a mailing job that needs to be done. I need to seperate the letters by the number of pages for each account that letter will be mailed to. I extracted data out of the report file to give me the account numbers and the number of pages for each account number as below:

    AcctNbr Pages
    123456 Page 1 of 2
    123456 Page 2 of 2
    456789 Page 1 of 2
    456789 Page 2 of 2
    444444 Page 1 of 1
    555555 Page 1 of 3
    555555 Page 2 of 3
    555555 Page 3 of 3
    987654 Page 1 of 4
    987654 Page 2 of 4
    987654 Page 3 of 4
    987654 Page 4 of 4
    I need a formula or way so that I can have the account number listed once along with the total number of pages for that account like below:
    AcctNbr PageCount
    123456 2
    456789 2
    444444 1
    555555 3
    987654 4
    This way I can then sort by Page Count. I have also attached an example spreadsheet. Any help with this will be greatly appreciated. I haven't had to do much Excel work in quite a while and have forgotten quite a bit.

    Thank you,
    Dave
    Attached Files Attached Files

  2. #2
    Forum Guru davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2007
    Posts
    1,879

    Re: Row Count Help

    You can use the Right() function to get the number of pages in each account. Then copy and paste the function to a value, and filter unique to get each account number once.
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  3. #3
    Registered User
    Join Date
    09-21-2011
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Row Count Help

    I figured it out myself. I used a simple COUNTIF formula and then ran a piece of VBA code that I have to remove the duplicates. But I appricate any replies that came my way. These forums are always very helpful.

    Thank you,

    Dave

  4. #4
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,572

    Re: Row Count Help

    Try this
    In D2
    =IFERROR(LOOKUP(999^99,CHOOSE({1;2},"",INDEX($A$2:$A$30,MATCH(TRUE,INDEX(ISNA(MATCH($A$2:$A$30,$D$1:$D1,0)),0),0)))),"")
    In E2
    =IF(D2="","",COUNTIF(A:A,D2))
    Drag/Fill Both Down
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.

+ 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.2.0