According to your last updated attachment a VBA demonstration for starters :

PHP Code: 
Sub Demo1()
        
Dim S&, W(2 To 4), R&, N&, C%, V()
        
Sheets(5).UsedRange.Offset(1).Clear
    With 
New Collection
    
For 2 To 4
        W
(S) = Sheets(S).[A1].CurrentRegion
    
For 2 To UBound(W(S))
        For 
1 To .Count
            C 
StrComp(.Item(N), W(S)(R2), 1)
         If 
>= 0 Then
            
If C Then .Add W(S)(R2), , N
            
Exit For
         
End If
        
Next
            
If > .Count Then .Add W(S)(R2)
    
Next RS
        
For 1 To .Count:  .Add R, .Item(R), R:  .Remove R 1:  Next
        ReDim V
(1 To .Count1 To 11)
    For 
2 To 3
    
For 2 To UBound(W(S))
        
= .Item(W(S)(N2))
        If 
IsEmpty(V(R1)) Then V(R1) = R: For 2 To 5V(RC) = W(S)(NC): Next
        V
(R6) = V(R6) + W(S)(N6)
        
V(R10) = V(R10) + W(S)(N- (2))
        If 
2 Then V(R11) = V(R11) + W(S)(N10)
    
Next NS
    
For 2 To UBound(W(4))
        
= .Item(W(4)(N2))
        
V(R7) = V(R7) + W(4)(N6)
        
V(R11) = V(R11) + W(4)(N8)
    
Next
    
For 1 To .Count
    
For 0 To 1
        
If V(RCThen V(RC) = V(R10 C) / V(RC)
    
Next CR
    End With
    With Sheets
(5).Range("A1:K" R).Columns
        
.Borders.Weight 2
        
.Font.Name = .Cells(1).Font.Name
        
.Item("A:G").NumberFormat "_W# ###_W;;; @ "
        
.Item("H:K").NumberFormat "_W# ##0.00_W;;; @ "
         
With .Rows("2:" R):  .Font.Size 12:  .Value V:  End With
        
.AutoFit
    End With
End Sub 
► Do you like it ? ► So thanks to click on bottom left star icon « Add Reputation » !