That's what this does:

=... ^ (1 / (MATCH(L4, $B$3:$B$45, 0) - MATCH(L3, $B$3:$B$45, 0) + 1)) - 1

... and this:

... ^ (1 / (M4 - M3 + 1) ) - 1