Create Summary Table From Data Sheet

ir121973

Active Member
Joined
Feb 9, 2008
Messages
371
Hi, I wonder whether someone may be able to help me please.

Firstly, my apologies because I'm not even sure whether this possible.

I have a Excel sheet (Sheet 1) which contains the following 'Dynamic' information which runs from column A to I with data rows starting at row 5.

NAMEFTEOct-12Nov-12Dec-12Jan-13Feb-13Mar-13Manager
Person 11.0012Manager A
Person 21.00202020202020Manager B
Person 30.78222Manager C
Person 11.000.755Manager A
Person 21.00222222Manager B
Person 50.500.50.50.50.50.50.5Manager F
Person 30.78Manager C
Person 41.50101010101010Manager D

<tbody>
</tbody>


On 'Sheet 2', I then have a Summary table which pulls it's data from Sheet 1.

The Summary table is in the following format.

Name (Column A)
FTE (Column B)
October Total (Column C)
November Total (Column D)
December Total (Column E)
January Total (Column F)
February Total (Column G)
March Total (Column H)
Manager (Column I)

with the data rows starting at row 5.

What I need to be able to do is search the data in the first sheet, find the first instance of the Name, copy this along with the the FTE and Manager. Then I need to search the table of all records pertinent to that person and add all the figures for each month, so using the above as an example the data would show:

NAMEFTEOct TotalNov TotalDec TotalJan TotalFeb TotalMar TotalManager
Person 11.001.757Manager A
Person 21.00222222222222Manager B
Person 30.78222Manager C
Person 41.50101010101010Manager D
Person 50.500.50.50.50.50.50.5Manager F

<tbody>
</tbody>

In it's current format I'm using a very cumbersome and time consuming method with many formulas and a lot of copying and pasting.

I just wondered whether someone could possibly take a look at this please and offer a little guidance on whether there may be a more efficient way of combining this information.

Many thanks and kind regards
 
Try this:-
Results Unsorted .
Code:
[COLOR="Navy"]Sub[/COLOR] MG14Oct47
[COLOR="Navy"]Dim[/COLOR] Rng         [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] Dn          [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] n           [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Dim[/COLOR] Ac          [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer[/COLOR]
[COLOR="Navy"]Dim[/COLOR] c           [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Dim[/COLOR] Cop
[COLOR="Navy"]Dim[/COLOR] Pst
 Cop = Array(1, 5, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27)
 Pst = Array(1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 30)
[COLOR="Navy"]With[/COLOR] Sheets("Combined")
    [COLOR="Navy"]Set[/COLOR] Rng = .Range(.Range("C4"), .Range("C" & Rows.Count).End(xlUp))
[COLOR="Navy"]End[/COLOR] With
        ReDim ray(1 To Rng.Count, 1 To 15)
            [COLOR="Navy"]With[/COLOR] CreateObject("scripting.dictionary")
                .CompareMode = vbTextCompare
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
    [COLOR="Navy"]If[/COLOR] Not .Exists(Dn.Value) [COLOR="Navy"]Then[/COLOR]
        n = n + 1
            [COLOR="Navy"]For[/COLOR] Ac = 0 To UBound(Cop)
                [COLOR="Navy"]If[/COLOR] n = 1 And Ac > 1 And Ac < UBound(Cop) [COLOR="Navy"]Then[/COLOR]
                    ray(n, Ac + 1) = MonthName(Month(Dn(, Cop(Ac))), True) & "-Tot"
                [COLOR="Navy"]Else[/COLOR]
                    ray(n, Ac + 1) = Dn(, Cop(Ac))
                [COLOR="Navy"]End[/COLOR] If
            [COLOR="Navy"]Next[/COLOR] Ac
        .Add Dn.Value, n
    [COLOR="Navy"]Else[/COLOR]
           [COLOR="Navy"]For[/COLOR] Ac = 2 To 13
                [COLOR="Navy"]If[/COLOR] Not .Item(Dn.Value) = 1 [COLOR="Navy"]Then[/COLOR]
                    ray(.Item(Dn.Value), Ac + 1) = ray(.Item(Dn.Value), Ac + 1) + Dn(, Cop(Ac)).Value
                [COLOR="Navy"]End[/COLOR] If
            [COLOR="Navy"]Next[/COLOR] Ac
   [COLOR="Navy"]End[/COLOR] If
[COLOR="Navy"]Next[/COLOR]
c = .Count
[COLOR="Navy"]End[/COLOR] With
[COLOR="Navy"]For[/COLOR] Ac = 0 To UBound(Pst)
    Sheets("Destination").Cells(4, Pst(Ac)).Resize(c) = application.Index(ray, Evaluate("row(" & LBound(ray) & ":" & UBound(ray) & " )"), Ac + 1)
[COLOR="Navy"]Next[/COLOR] Ac
MsgBox "Run!!"
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]
Regards Mick
 
Upvote 0

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi @Mick G, this is again, fantastic, thank you so much for revisiting my post and taking the time and trouble to post a new solution. It truly is appreciated.

All the best and kind regards

Chris
 
Upvote 0

Forum statistics

Threads
1,216,122
Messages
6,128,967
Members
449,480
Latest member
yesitisasport

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top