Please don't post just pics, always attach the worksheet, please.
I guess it should be j:=0..n and not j:=0..r
OK, so it seems to be that typo, as I thought.
i have one more error on the same file. Necessary file is attached.
You can use vectorization only with vectors of the same dimensions. F has 10^5 but W has 10^6 elements.
Right at the top at the definition of W change the 100000 to 10000 to make it work (better use powers of 10 which shows you the difference at a glance)