+ Reply to Thread
Results 1 to 8 of 8

Summarise 100,000 lines of data

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    808

    Summarise 100,000 lines of data

    I am trying to summarise recurring blocks of data which occur at regular iteravals within 100,000 lines of data. Each array contains the costs by cost code (up to 30)and properties (2,000). Help! I have attempted indexation and =mod but I'm not even coming close.

    Any help very much appreciated - a data sample spreadsheet is below.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Summarise 100,000 lines of data

    So you are not trying to summarize data, but process and standardize it correct?
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Summarise 100,000 lines of data

    See if this is what you're looking for.
    Attached Files Attached Files
    David
    (*) Reputation points appreciated.

  4. #4
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    808

    Re: Summarise 100,000 lines of data

    Thanks David

    I have just run out of resources trying to do it using array formula. Your solution looks great - I will try it now on the sheet and get back to you.

  5. #5
    Forum Contributor
    Join Date
    12-02-2008
    Location
    Brisbane
    MS-Off Ver
    2016
    Posts
    808

    Re: Summarise 100,000 lines of data

    Hi David

    That is awesome. I am working my way through the VBA to see how it all works but it's brilliant. Thank you - I will be able to enjoy my weekend now! Much reputation added.

  6. #6
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Summarise 100,000 lines of data

    That's great! Glad it worked out for you.

    How long does it take to run on 100,000 lines?

  7. #7
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Summarise 100,000 lines of data

    Can you post the code in the forum and provide the comments so we can understand what is going on?

  8. #8
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Summarise 100,000 lines of data

    Sure. I was debating on whether to do that or not.
    Sub Summarize()
    Dim WS As Worksheet
    Dim C As Range
    Dim D As Range
    Dim FirstAddress As String
    Dim A As Long
    Dim B As Long
    Dim LastRow As Long
    Dim CCRow As Long
    Dim CCcol As Long
    
    Set WS = Worksheets("Sheet1")
    
    With WS
        'Clear the summary range.
        .Range("B11:BXY40").ClearContents
        
        'Determine last row of data in the sheet.
        LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
        
        'Define range from the start of data to the lastrow.
        With .Range("A42:A" & LastRow)
            'Look for the Phrase 'Cost Code'.
            Set C = .Find("Cost Code", , xlValues)
    
            If Not C Is Nothing Then
                'We found it.
                'Store the first found address for later.
                FirstAddress = C.Address
                
                'Start a Do-Loop to find all the phrases.
                Do
                
                'Each group is a maximum of 10 by 25 table.
                'Iterate the group range.
                For A = 1 To 25 'offset of Columns
                    For B = 1 To 10 'offset of Rows
                        
                        'Check to make sure the row/column data isn't empty.
                        If C.Offset(B, A) <> "" Then
                            'Search the summary table, looking for matching header row.
                            Set D = WS.Range("A10:A40").Find(C.Offset(B, 0), , xlValues)
                            'Store the row number.
                            CCRow = D.Row
                            Set D = Nothing
    
                            'Search the summary table, looking for matching header column.
                            Set D = WS.Range("B10:BXY10").Find(C.Offset(0, A), , xlValues)
                            'Store the column number.
                            CCcol = D.Column
    
                            'We now have the address on the table for the data.
                            WS.Cells(CCRow, CCcol) = C.Offset(B, A)
                        End If
                    Next
                Next
                'Keep looking for more phrases.
                Set C = .Find("Cost Code", C, xlValues)
                'Stop when it's finished.
                Loop While Not C Is Nothing And C.Address <> FirstAddress
            End If
        End With
    End With
                
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Summarise data
    By harignz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-05-2014, 03:35 AM
  2. Summarise data
    By NWSIT in forum Excel General
    Replies: 2
    Last Post: 11-30-2010, 02:42 PM
  3. Pie chart to summarise data
    By t0v3 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-08-2008, 11:05 AM
  4. How do you summarise data from two columes
    By drgogo in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-29-2008, 12:13 PM

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