First, the SUM function serves no useful purpose in this context. I don't know why some people do that. Poor training, I guess.
The formula =F4*(1+E4)^D4 calculates the future value (FV) of F4 based on an annual inflation (E4) compounded annually over 5 years (D4).
A simpler formula is:
=FV(E4, D4, 0, -F4)
or
=-FV(E4, D4, 0, F4)
I use -F4 because I like financial functions to return a positive dollar value.
But the point is: most (but not all, sigh) Excel financial functions expect signed cash flows: negative for one direction (e.g. inflows), and positive for the other direction (e.g. outflows).
The choice of sign and direction is arbitrary. You can think of it as depending on point of view. If you like negative inflows, you are the saver. If you like positive inflows, you are the bank. But whichever sign you use for one direction, be sure to use the opposite sign for the other direction.