+ Reply to Thread
Results 1 to 7 of 7

Mass Data Table in to Workable Format!

Hybrid View

  1. #1
    Registered User
    Join Date
    05-27-2021
    Location
    Nottingham, England
    MS-Off Ver
    2013
    Posts
    3

    Mass Data Table in to Workable Format!

    Hi All,

    New to the forum, hoping you'll be able to solve a problem I have been stuck on for weeks!! I have tried google, youtube etc but I don't think i'm able to search the correct terms for what I'm wanting to do... which is how I came across you guys and girls!!

    I get this data on a weekly basis from our payroll department (all personal data has been removed from the file for this query).
    I'm wanting to make the format cleaner, so I can then use the data for other reports. Currently the table is in a horizontal format, with 70+ headers meaning I have to transpose the headers and then individually look up the 160 employees to get the data in a tabular format, I can use the match or lookup functions, but this means individually changing the lookup row for each employee and can also do the old fashioned copy and paste, but again I would need to repeat this 100's of times to get the data aligned, it's do-able but massively time consuming.

    The personal data columns aren't needed, I just need the financial data starting from column T (employers NI) to Column CM (trading bonus)

    example of my explanation/idea below;

    Current state;

    Salary Tax Bonus Car Allowance Pension
    Person A X X X X X
    Person B X X X X X
    Person C X X X X X

    Goal


    Person A Salary X
    Person A Tax X
    Person A Bonus X
    Person A Car X
    Person A Pens X
    Person B Salary X

    etc...

    OR

    Person A Salary X
    Person B Salary X
    Person C Salary X
    Person A Tax X

    etc.

    I am on excel 2013 and if an additional extension was needed I would need approval from IT, so i'm hoping there is something already set up, a formula or a macro that I can do this with.
    If this doesn't make sense please let me know and i'll try and put a bit more info together!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,882

    Re: Mass Data Table in to Workable Format!

    Are we looking to extract from 70 + columns (T to CM) where much of the data is blank (if your sample is typical): if no data is present, is this to be ignored for a given personnel number (so information per person is variable) ?

  3. #3
    Registered User
    Join Date
    05-27-2021
    Location
    Nottingham, England
    MS-Off Ver
    2013
    Posts
    3

    Re: Mass Data Table in to Workable Format!

    Hi John,

    This is the typical format of the sample, there'll be many blank cells unfortunately.

    So to answer your question.... which ever would be easiest to reach the goal! Essentially I need the cells with data in to marry up with the personnel number.

    I can use the fill blanks function to give a value for each cell therefore making the data consistent for all personnel numbers if that makes the solution easier to achieve and eliminate the variable element.

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,882

    Re: Mass Data Table in to Workable Format!

    No point in filling in "dummy" data if you OK with a variable set of information per person.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,882

    Re: Mass Data Table in to Workable Format!

    Sub Get_PData()
    
    Dim inarr()
    Dim rng As Range
    
    'Optimize Macro Speed
    Application.ScreenUpdating = False
    Application.EnableEvents = False
    Application.Calculation = xlCalculationManual
    
    Worksheets("Data").Activate
    
    lastrow = Cells(Rows.Count, 1).End(xlUp).Row
    lastcol = Cells(1, Columns.Count).End(xlToLeft).Column
    
    inarr = Range("A1").CurrentRegion
    
    Dim outarr(1 To 10000, 1 To 3)
    
    n = 0
    
    For i = 2 To UBound(inarr, 1)
    
        pRef = inarr(i, 1)
        
        For j = 20 To 91
        If inarr(i, j) <> 0 Then
            n = n + 1
            outarr(n, 1) = pRef
            outarr(n, 2) = inarr(1, j)
            outarr(n, 3) = inarr(i, j)
        End If
        Next j
        
    Next i
    
    
    Set Destination = Worksheets("Goal").Range("A2")
    Destination.Resize(UBound(outarr, 1), UBound(outarr, 2)).Value = outarr
    
    
    
    'Reset Macro Optimization Settings
        Application.EnableEvents = True
        Application.Calculation = xlCalculationAutomatic
        Application.ScreenUpdating = True
        
    
    
    
    End Sub

    See sheet "Goal"
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-27-2021
    Location
    Nottingham, England
    MS-Off Ver
    2013
    Posts
    3

    Re: Mass Data Table in to Workable Format!

    Quote Originally Posted by JohnTopley View Post
    Sub Get_PData()
    
    Dim inarr()
    Dim rng As Range
    
    'Optimize Macro Speed
    Application.ScreenUpdating = False
    Application.EnableEvents = False
    Application.Calculation = xlCalculationManual
    
    Worksheets("Data").Activate
    
    lastrow = Cells(Rows.Count, 1).End(xlUp).Row
    lastcol = Cells(1, Columns.Count).End(xlToLeft).Column
    
    inarr = Range("A1").CurrentRegion
    
    Dim outarr(1 To 10000, 1 To 3)
    
    n = 0
    
    For i = 2 To UBound(inarr, 1)
    
        pRef = inarr(i, 1)
        
        For j = 20 To 91
        If inarr(i, j) <> 0 Then
            n = n + 1
            outarr(n, 1) = pRef
            outarr(n, 2) = inarr(1, j)
            outarr(n, 3) = inarr(i, j)
        End If
        Next j
        
    Next i
    
    
    Set Destination = Worksheets("Goal").Range("A2")
    Destination.Resize(UBound(outarr, 1), UBound(outarr, 2)).Value = outarr
    
    
    
    'Reset Macro Optimization Settings
        Application.EnableEvents = True
        Application.Calculation = xlCalculationAutomatic
        Application.ScreenUpdating = True
        
    
    
    
    End Sub

    See sheet "Goal"
    Thank you so SO much!!

    I'm assuming with this Macro I can just copy the script in to my macro book and providing the data is aligned it should now run for all the reports in this format?

+ 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. [SOLVED] Group numbers into workable ranges in order to run a pivot table (days taken to update)
    By Bunny Screen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-30-2014, 09:14 AM
  2. Put data into workable format in Excel
    By dhbiv in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-31-2014, 08:56 PM
  3. [SOLVED] Trouble pasting data in Excel in a workable format
    By mrvp in forum Excel General
    Replies: 9
    Last Post: 09-21-2013, 08:20 AM
  4. Calculate workable time table
    By Lambshots in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 03-19-2013, 05:43 PM
  5. Reformatting one column of text into a workable table
    By handsomehed in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 05-09-2010, 02:41 PM
  6. Help Turning Mass of Data into Readable Format
    By dvent in forum Excel General
    Replies: 1
    Last Post: 03-22-2010, 06:33 AM
  7. formating data exported into Excel into a workable format.
    By tomholden in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-15-2007, 11:30 AM

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