I am trying to have a cell keep a YTD total

Having it correlate to a certain cell (A1),

If A1=1, then equal just one month.

If A1=2, then sum first month and second.

and so on.

However I have percentages and would like to know the sum/average/complete percentage of all the months depending on what
A1 is equal to