+ Reply to Thread
Results 1 to 16 of 16

Consolidation of 3 Lists in excel driven by custodian name

  1. #1
    Registered User
    Join Date
    02-28-2012
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    21

    Consolidation of 3 Lists in excel driven by custodian name

    Okay I have these huge files that has three columns- one has the start # , second the end of that series #, and then the custodian- who it belongs to. there are 60,000 entries..
    -------------------------------------------------------------------------------
    Column A: Begin Number
    Column B: End Number
    Column C: Custodian
    Column D: Page Count
    -----------------------------------
    Each Custodian in Column C (it is not unique - only the range will be (Column A-B #))
    is associated with a range of values found in Column A to Column B (it stops where the custodian name changes and so forth...) The page count sum is the value sum of page count associated with the custodian for that range. I need to summarize the entire sheet to look like the results- where the range is specificied from Column A - to Column B - for that specific custodian - and the page range (this is also the numerical difference of value in Col A- Col B) +1.

    Any suggestions would help.

    I attempted to write a macro *Being unfamilar with VBA - but it was not successful since the # in Column A is the beginning of a series (with a custodian) & # in Column B is only where the custodian name before it changes. Please see the attached files -as they illustrate the idea better than I can explain it.


    The attached file has the manual done-results and the second tab the data I am trying to make to look like the results.
    Last edited by eeanil; 02-28-2012 at 03:02 PM.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Consolidation of 3 Lists in excel driven by custodian name

    My recommendation. Insert a helping column and label each item into a group. You first might want to extract Beginning Number and Ending Number from your page number columns using TextToColumns, then use the macro as an example to group them, then summarize use Pivot Table with Column Group, Custodian and Total Page #, and joint other columns using vlookup.

    The code below is an example of how to group the

  3. #3
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Consolidation of 3 Lists in excel driven by custodian name

    Oh sh*t. I didn't realize you have more than 1,000 items. Never mind what I said.

  4. #4
    Registered User
    Join Date
    02-28-2012
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Consolidation of 3 Lists in excel driven by custodian name

    Hi JieJenn

    yeah - i have a huge list of items , the pivot table wont work because a custodian name might appear hundreds of time- but is only associated with the specific range # where it appears and the pivot will sum up anywhere the same name appears. I looked at the macro you ran- basically if I could run that macro down the list and generate a range and names that would work. - - Can you explain that macro to me ? Because in theory , if I can get something similar but more broad I can run it and it should give me each custodian and the range, and page count.

  5. #5
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Consolidation of 3 Lists in excel driven by custodian name

    Kool. Yeah sorry I am not very helpful. Anyway, for the macro

    the LR statement is locating the last row # of column 2

    For i = 2 to LR is loop from Row2 to last row. What the loop does is it is looking at Location B & i (B1, B2, B3, B4, etc) and F & i (F1, F2, F3, F4), and if the item in the range meet the criteria or condition insert 1 in A & i (A1, A2, A3, A4, etc). The same goes to the next few IF statements

  6. #6
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Consolidation of 3 Lists in excel driven by custodian name

    hi eeanil, please check attachment, press "Run" button, the data is supposed to be located on the sheet named "Sheet1" and be sorted as in the example.
    Attached Files Attached Files
    Last edited by watersev; 02-28-2012 at 06:46 PM.

  7. #7
    Registered User
    Join Date
    02-28-2012
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Consolidation of 3 Lists in excel driven by custodian name

    Hi watersev,
    Thanks for your time & file,but... I can see your code works for the example, but my original file has more than 60,000 rows of data- how do I get that macro to be implemented in such a situation ? Any ideas ? Thanks,...
    Thanks for trying.
    Last edited by eeanil; 02-28-2012 at 07:55 PM.

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Consolidation of 3 Lists in excel driven by custodian name

    @eeanil, the code has no limitation on number of rows to process as soon as conditions set in post #6 are met

  9. #9
    Registered User
    Join Date
    02-28-2012
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Consolidation of 3 Lists in excel driven by custodian name

    Watersev--

    Okay I checked the macro code and now I know why your macro wont run on my original data.
    The sample I uploaded had prefixes in the beg/end # with DUPTIO- , but the original file
    has several different prefixes.

  10. #10
    Registered User
    Join Date
    02-28-2012
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Consolidation of 3 Lists in excel driven by custodian name

    @Watersev-

    How do I adjust the code so the prefix is taken care of ? - I.e. DUPTIO-xxxxx , HILL-xxxx HALEY-xxx
    Because I have several different types of these, is there a general way to run the loop so it takes care of these ? I am not a whiz with VBA so im not sure how to adjust the code for that.

    I appreciate your help greatly.

  11. #11
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Consolidation of 3 Lists in excel driven by custodian name

    can you provide extract from original file with different prefixes?

  12. #12
    Registered User
    Join Date
    02-28-2012
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Consolidation of 3 Lists in excel driven by custodian name

    @Watersev

    Okay I have attached an extract which has multiple different beginning & end # 's
    Thanks.
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Consolidation of 3 Lists in excel driven by custodian name

    please check attachment, option to make it, press "Run"
    Attached Files Attached Files

  14. #14
    Registered User
    Join Date
    02-28-2012
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Consolidation of 3 Lists in excel driven by custodian name

    @watersev


    I attempted to run the macro on the original data, but it says type mismatch error.

    When I stepped into the code- it was these following lines the code was having trouble executing it seems:


    result(j, 4) = CLng(myobj.Replace(result(j, 2), "")) - CLng(myobj.Replace(result(j, 1), "")) + 1

    -- It seems to run when I cut up the file into two pieces and run separately, but otherwise the error comes when I run the macro on the entire file.
    -- Because the file is too big I cannot upload it here. Anyway I can send you a copy- via email ?

    Thank You.
    Last edited by eeanil; 02-29-2012 at 06:06 PM.

  15. #15
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Consolidation of 3 Lists in excel driven by custodian name

    that means the either Begin number or End number have no numbers in them

    try this option, it should give you a message box with first encountered strings without numbers:

    Please Login or Register  to view this content.

  16. #16
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Consolidation of 3 Lists in excel driven by custodian name

    check this option, if one of the "numbers" will have no digits, the Page Count will be equal to "no numbers" string or advise how to process such cases
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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