I have been missing a formula that could calculate the Normalized Power for a given interval workout and there's been some threads in the past about this issue too.
NP can be easily calculated with a simple spreadsheet formula if you forget about the smoothed average and use plain 30s average instead, which will give totally adequate accuracy but anyway I had some spare time (read, I really should start work but am still in summer vacation mood and motivation is lurking somewhere behind the corner ) so I decided to write a specific function for it.
Just copy+paste the code below to Excel VBA module (preferably in 'PERSONAL' workbook which makes it available to all workbooks) and use it as any Excel funtion.
NP can be easily calculated with a simple spreadsheet formula if you forget about the smoothed average and use plain 30s average instead, which will give totally adequate accuracy but anyway I had some spare time (read, I really should start work but am still in summer vacation mood and motivation is lurking somewhere behind the corner ) so I decided to write a specific function for it.
Just copy+paste the code below to Excel VBA module (preferably in 'PERSONAL' workbook which makes it available to all workbooks) and use it as any Excel funtion.
Public Function PNorm(p1 As Double, t1 As Long, p2 As Double, t2 As Long, intCount As Long)
'p1 = interval power
't1 = interval time in seconds
'p2 = recovery power
't2 = recovery time in seconds
'intCount = number of intervals
'variable SWindowSize is the lenght of the smoothing window. Default value 30 but
' you can obviously change it.
'note! NP is calculated from the start of the first interval until the end of the last interval
Dim i, j, totalTime, SWindowSize, intervalTest As Long
Dim runningTotal, runningAverage, runningSqTotal As Double
SWindowSize = 30
totalTime = t1 * intCount + t2 * (intCount - 1)
For i = 1 To totalTime
j = i - SWindowSize
intervalTest = Int((i - (t1 + t2) * Int((i - 1) / (t1 + t2)) - 1) / t1)
If intervalTest = 0 Then
runningTotal = runningTotal + p1
Else
runningTotal = runningTotal + p2
End If
If i > SWindowSize Then
intervalTest = Int((j - (t1 + t2) * Int((j - 1) / (t1 + t2)) - 1) / t1)
If intervalTest = 0 Then
runningTotal = runningTotal - p1
Else
runningTotal = runningTotal - p2
End If
End If
runningAverage = runningTotal / SWindowSize
runningSqTotal = runningSqTotal + runningAverage ^ 4
Next
PNorm = (runningSqTotal / totalTime) ^ (1 / 4)
End Function