+ Reply to Thread
Results 1 to 10 of 10

Trying to create a report that shows grouped records based of an excel spreadsheet

  1. #1
    Forum Contributor
    Join Date
    06-30-2008
    Location
    PSL, FL
    Posts
    271

    Trying to create a report that shows grouped records based of an excel spreadsheet

    I was hoping the forum could help me with one last piece to my puzzle.

    I am currently creating a large excel spreadsheet to track Traffic Tickets for my police department and I am having an issue with previous data. I was hoping someone would be willing to lend a hand.



    I need to create a short report? I was thinking of doing it via pivot table.

    Basically I need it look like below

    It will list each book in order from 1 through 1751 with a page break between each book.

    then each Book will look like this

    Book # - Date In - Date of Citation - Citation # - Def name - Officer name

    Then I want it to autogenerate the numbers


    Each ticket book has the following range.

    ####-AAA

    with the 3rd and 4th digit being the of the numbers being the range of a book for example.

    ##01-AAA through ##25-AAA is a book

    ##26-AAA through ##50-AAA is a book

    ##51-AAA through ##75-AAA is a book

    ##76-AAA through ##00-AAA is a book


    So even if Book 1 only had 21 tickets in needs to list all 25 just will leave the info blank?

    Is this possible? I have attached a sample workbook zipped up. This workbook has no personal information.


    Matt
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Trying to create a report that shows grouped records based of an excel spreadsheet

    So you want each book number relisted 25 times each so a total of 25*1751 rows? Then give each a autogenerated number? Does the number always end with "-AAA" or does each set of 25 get a new ending? Maybe you can repost the sample, and in Sheet2, you can show what you are looking for for at least 50 lines....
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Contributor
    Join Date
    06-30-2008
    Location
    PSL, FL
    Posts
    271

    Re: Trying to create a report that shows grouped records based of an excel spreadsheet

    ok I will show below

    This is data from book #1 I sorted by Citation # then sorted by Book #

    So then I copied all the data of Book #1

    HTML Code: 
    if you look at the citation list you will see that the following tickets were never turned in (For whatever reason, mistake, ruined, etc)

    04
    05
    06
    19
    these are the 3rd and 4th digits of the following book

    73XX-BNO

    I would like the report to read like this look at the lines with N/A for the updated information.


    HTML Code: 

  4. #4
    Forum Contributor
    Join Date
    06-30-2008
    Location
    PSL, FL
    Posts
    271

    Re: Trying to create a report that shows grouped records based of an excel spreadsheet

    So I would like to run a report where it would print 1 page (Per Book) just as I describe above.

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Trying to create a report that shows grouped records based of an excel spreadsheet

    Have a look at the attached.. Sheet2.

    First in E2 I added formula:

    =MOD(INT((ROWS($A$1:$A1)-1)/25),1751)+1

    copied down.

    Then in H2, I added a helper column with formula:

    =INDEX(Sheet1!D:D,MATCH(E2,Sheet1!E:E,0)) (you can hide the column)

    In D2:

    =LEFT(H2,2)&TEXT(FLOOR(MID(H2,3,2)+0,25)+MOD(ROWS($A$1:$A1)-1,25)+1,"00")&MID(H2,5,10)

    copied down.

    Note: The formulas in D and E cause the workbook to process dramatically slow.. you can copy and paste special>> Values over themselves after to eliminate the formulas.

    In A2, then

    =INDEX(Sheet1!A:A,MATCH($D2,Sheet1!$D:$D,0))

    copied down and across to column C

    in F2,

    =INDEX(Sheet1!F:F,MATCH($D2,Sheet1!$D:$D,0))

    copied down and across to G,

    Hope it helps.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    06-30-2008
    Location
    PSL, FL
    Posts
    271

    Re: Trying to create a report that shows grouped records based of an excel spreadsheet

    Looks great? A few Questions.

    Does this need to be done every time? Or can I create a macro and run it? I ask because I will be adding tickets in the future to Sheet 1?

    also

    Is there a way to have a page break between books?

    Thanks

    Matt

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Trying to create a report that shows grouped records based of an excel spreadsheet

    The formula in column E is meant for 1751 groups of 25 tickets.. if you will have more groups, change the 1751.... and copy down

    If you add items in sheet1 then the N/A's should be replaced automatically with the corresponding information...

    To add page breaks, you will need VBA... you can ask this question specifically in the Programming forum, as the VBA is not my scope here...

  8. #8
    Forum Contributor
    Join Date
    06-30-2008
    Location
    PSL, FL
    Posts
    271

    Re: Trying to create a report that shows grouped records based of an excel spreadsheet

    Not a problem

    Thanks

    Matt

  9. #9
    Forum Contributor
    Join Date
    06-30-2008
    Location
    PSL, FL
    Posts
    271

    Re: Trying to create a report that shows grouped records based of an excel spreadsheet

    NBMC,

    Where you put that 1751 in Sheet 2 is there a way I can use the max command to have that check sheet 1 for the max Book number and replace it?


    right now you have this

    =MOD(INT((ROWS($A$1:$A1)-1)/25),1751)+1

    cant we do something here?

    Matt

  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Trying to create a report that shows grouped records based of an excel spreadsheet

    To avoid multiple calculations, enter in an empty cell in sheet2, this formula:

    =MAX(Sheet1!E:E)

    then change formula to:

    =MOD(INT((ROWS($A$1:$A1)-1)/25),$X$1)+1

    where X1 contains the MAX() formula.

+ 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