Sub test2()
Dim rng As Range
Dim lastCol As String
Dim lastRow As Long
Sheets("FinalData").Select
'Set range variable to last column in row 2 with data
Set rng = Cells(2, Columns.Count).End(xlToLeft)
'Find last column letter of this cell in row 2
lastCol = Split(rng.Address, "$")(1)
'Find last row in column A with data
lastRow = Cells(Rows.Count, "A").End(xlUp).Row
'Populate new headers in row 2
rng.Offset(0, 1) = "Running"
rng.Offset(0, 2) = "Cycling"
rng.Offset(0, 3) = "Strength(Mins)"
'Populate formulas into row 2
rng.Offset(1, 1).Formula = "=Sumif($B$2:" & lastCol & "$2,""*Running*"",B3:" & lastCol & "3)"
rng.Offset(1, 2).Formula = "=Sumif($B$2:" & lastCol & "$2,""*Cycling*"",B3:" & lastCol & "3)"
rng.Offset(1, 3).Formula = "=Sumif($B$2:" & lastCol & "$2,""*Strength(Mins)*"",B3:" & lastCol & "3)"
'Copy down for all rows
Range(rng.Offset(1, 1), rng.Offset(1, 3)).Copy Range(rng.Offset(1, 1), rng.Offset(lastRow - 2, 1))
End Sub