Google Sheets – How to Calculate Running Average

formulasgoogle sheetsgoogle-sheets-arrayformula

I'm new to data analytics. This might be a simple solution but I could not find it after 2 weeks of trying. I have a column of numbers that represent wins and losses. Losses are represented as "0" and wins are represented as "1". Is there a way (an array formula) that I can create a dynamic win rate column? These values to get a running total like how I manually entered them in column B?

(w/L , Win %)
(0  ,00)
(1,.50)
(1 .67)
(1 .75)
(0 .60)

https://docs.google.com/spreadsheets/d/1781D5ZNJ4tKzIOhPjrfIW0JRLlbWNUwI6L_4APyYhP8/edit#gid=0

Best Answer

See Test sheet

In cell E2 there is following formula

=ARRAYFORMULA(
 SUMIF(
  SEQUENCE(COUNT(A2:A),1,1,1),"<="&SEQUENCE(COUNT(A2:A),1,1,1),A2:A)
  /COUNTIF(SEQUENCE(COUNT(A2:A),1,1,1),"<="&SEQUENCE(COUNT(A2:A),1,1,1)))

With SEQUENCE() we create index column for each of your entry in order to calculate sum of preceding results.

Then using SUMIF() we basically sum all prior results and divide by number of events.