The best way to do this is by converting your data to an Excel table. Select your data range (A1:E11), press Ctrl + T, and click OK. Excel names it something like "Table1"; in my case, it's Table3, ...
The simplest way to think about SCAN is that it applies a custom calculation to each element in a range/array and returns every intermediate result it produces along the way. If that sounds abstract, ...