Sub Demo1()
Dim N&, L&, R&, F
N = [F1].CurrentRegion.Rows.Count - 2: If N < 1 Then Beep: Exit Sub
With [I1].CurrentRegion.Rows
If .Count > 2 Then .Item("3:" & .Count).Clear
End With
L = 2
With [A1].CurrentRegion.Rows
For R = 3 To .Count
F = Evaluate(Replace("IF({1},""=""&ADDRESS(ROW(#),COLUMN(#)))", "#", .Item(R).Resize(, 6).Address))
F(2) = F(2) & "*$N" & L + 1: F(5) = "=$F3": F(6) = "=$G3"
Rows(L + 1).Resize(N).Columns("I:N").Formula = F
L = L + N
Next
End With
If L > 2 Then
With Range("I3:N" & L)
.Borders.Weight = 2
.Columns(2).NumberFormat = " #,##0.00_)"
End With
End If
End Sub