g | x | w | all
Bytes Lang Time Link
041AWK250401T190239Zxrs
040Arturo230121T163523Zchunes
036Factor + math.unicode230121T155857Zchunes
010Japt180502T182044ZShaggy
027Julia 0.6180702T143435ZSundar R
033Excel180503T110112ZWernisch
065Ruby180509T235648Zlfvt
010MATL180503T180239ZDJMcMayh
033Excel180503T145000Zdissemin
025TIBasic180503T130521ZTimtech
046Clojure180503T072437ZNikoNyrh
016J180503T082820ZGalen Iv
057Java 8180503T070537ZKevin Cr
014K4 / K oK180502T202452Zmkst
014Charcoal180502T203829ZNeil
033Octave180502T195310ZLuis Men
013APL+WIN180502T171125ZGraham
008Stax180502T172708Zwastl
028R+pryr180502T165247ZJayCe
028Perl 5 pa180502T173604ZXcali
006Stax180502T172905ZKhuldrae
049Triangularity180502T171602ZMr. Xcod
049JavaScript Node.js180502T164245ZDanielIn
035Haskell180502T165127ZAngs
038Python 3180502T170843ZDennis
00705AB1E180502T164340ZEmigna
006Husk180502T170641ZMr. Xcod
007Jelly180502T165757ZDennis
009Jelly180502T164044ZMr. Xcod

AWK, 41 bytes

{for(i=0;i++<NF;)x+=$i*NR}END{print x/70}

Attempt This Online!

{           # run each line
for(i=0;    # reset to zero each row
i++<NF;)    # each element of row
x+=$i*NR    # number times row number added to sum
}           # at end of line
END{        # when no more rows
print x/70}

Arturo, 40 bytes

$[a][i:0(sum map a'x[x*1+i/7i:i+1])//70]

Try it

Factor + math.unicode, 36 bytes

[ [ 7 /i 1 + * ] map-index Σ 70 / ]

Try it online!

Japt, 11 10 bytes

xÈ/#F*ÒYz7

Try it


Explanation

 È             :Pass each element at index Y through a function
  /#F          :  Divide by 70
       Yz7     :  Floor divide Y by 7
      Ò        :  Negate the bitwise NOT of that to add 1
     *         :  Multiply both results
x               :Reduce by addition

Julia 0.6, 27 bytes

p->repeat(1:4,inner=7)'p/70

Try it online!

The repeat call forms a column matrix of 28 values, containing seven 1's, then seven 2's, etc. We then transpose it with ', then do a matrix multiplication with the input (mutiplication is implicit here). Since it's a matrix multiplication of a 1x28 matrix with a 28x1 matrix, we end up with a single value, which is the weighted sum we need. Divide that by 70 to get our weighted mean.

Excel, 36 33 bytes

-3 bytes thanks to @tsh.

=SUM(1:1,H1:AB1,O1:AB1,V1:AB1)/70

Input in first row (A1 to AB1).

Ruby, 65 bytes

->r{(b=(0..r.size/7).map{|a|r[a*7..-1]}.flatten).sum/b.size.to_f}

Try it online!

MATL, 10 bytes

7es4:*s70/

Try it online!

I haven't posted a MATL answer in ages! Figured I might participate as part of LOTM May 2018!

Explanation:

7e          % Reshape the array into 7 rows (each week is one column)
  s         % Sum each column
   4:       % Push [1 2 3 4]
     *      % Multiply each columnar sum by the corresponding element in [1 2 3 4]
      s     % Sum this array
       70/  % Divide by 70

Excel: 33 bytes

(3 bytes saved from @wernisch's answer by running data on 2 lines from A1:N1 and A2:N2)

=AVERAGE(A1:N2,H1:N2,A2:N2,H2:N2)

Apologies for not including this as a comment. I don't have enough reputation to do so.

TI-Basic, 25 bytes

mean(Ansseq(sum(I>{0,7,21,42}),I,1,70

Alternate solution, 39 bytes

Input L1
For(I,1,70
Ans+L1(I)sum(I>{0,7,21,42
End
Ans/70

Clojure, 48 46 bytes

#(/(apply +(for[i[0 7 14 21]v(drop i %)]v))70)

This ended up being shorter than mapcat + subvec combination.

J, 16 bytes

70%~1#.]*7#4{.#\

Explanation:

              #\           finds the lengths of all successive prefixes (1 2 3 4 ... 28)
           4{.             takes the first 4 items (1 2 3 4)
         7#                creates 7 copies of each element of the above list
       ]*                  multiplies the input by the above 
    1#.                    sum
70%~                       divide by 70

Try it online!

Java 8, 57 bytes

a->{int r=0,i=35;for(;i-->7;)r+=i/7*a[i-7];return r/70d;}

Try it online.

Explanation:

a->{              // Method with integer-array parameter and double return-type
  int r=0,        //  Result-sum, starting at 0
      i=35;       //  Index-integer, starting at 35
  for(;i-->7;)    //  Loop `i` downwards in the range (35,7]
    r+=           //   Add the following to the result-sum:
       i/7        //    `i` integer-divided by 7,
       *a[i-7];   //    multiplied by the item at index `i-7`
  return r/70d;}  //  Return the result-sum, divided by 70.0

K4 / K (oK), 19 16 14 bytes

Solution:

+/(1+&4#7)%70%

Try it online!

Example:

+/(1+&4#7)%70%50 50 50 50 50 50 50 10 10 10 10 10 10 10 50 50 50 50 50 50 50 50 50 50 50 50 50 50
42

Explanation:

Evaluation is perform right-to-left. Divide 7 1s, 7 2s, 7 3s and 7 4s by 70 divided by the input; then sum up.

+/(1+&4#7)%70% / the solution               
           70% / 70 divided by the input
  (      )%    / the stuff in brackets divided by this...
      4#7      / draw from 7, 4 times => 7 7 7 7
     &         / 'where' builds 7 0s, 7 1s, 7 2s, 7 3s
   1+          / add one
+/             / sum (+) over (/) to get the total

Charcoal, 14 bytes

I∕ΣE⪪A⁷×Σι⊕κ⁷⁰

Try it online! Link is to verbose version of code. Explanation:

     A          Input array
    ⪪ ⁷         Split into subarrays of length 7
   E            Loop over each subarray
         ι      Subarray
        Σ       Sum
           κ    Loop index
          ⊕     Incremented
       ×        Product
  Σ             Sum results
            ⁷⁰  Literal 70
 ∕              Divide
I               Cast to string
                Implicitly print

Octave, 33 bytes

@(x)sum(reshape(x,7,4)*(1:4)')/70

Try it online!

APL+WIN, 13 bytes

Prompts for array as a vector of integers:

(+/⎕×7/⍳4)÷70

Explanation:

7/⍳4) create a vector comprising 7 1s, 7 2s, 7 3s and 7 4s

+/⎕× prompt for input, multiply by the vector above and sum result

(....)÷70 divide the above sum by 70

Stax, 10 8 bytes

äΔ6◙█µøΓ

Run and debug it

Explanation (unpacked):

7/4R:B$:V Full program, implicit input
7/        Split into parts of length 7
  4R      Push [1, 2, 3, 4]
    :B    Repeat each element the corresponding number of times
      $   Flatten
       :V Average

R+pryr, 32 28 bytes

and the same average score week over week would result in equality of the means.

pryr::f(s%*%rep(1:4,e=7)/70)

Try it online!

Saved 4 bytes by using dot product thanks to Giuseppe.

Pure R would have two more bytes using function

Perl 5 -pa, 28 bytes

$\+=$_/70*int$i++/7+1for@F}{

Try it online!

Input is space separated rather than comma separated.

Stax, 6 bytes

ñI"%"╟

Run and debug it at staxlang.xyz!

Unpacked (7 bytes) and explanation:

7/|]$:V
7/         Split into groups of seven.
  |]       Suffixes
    $:V    Flatten and average. Implicit print as fraction.

Triangularity, 49 bytes

....)....
...D7)...
..14)21..
.WM)IEtu.
}u)70s/..

Try it online!

Explanation

)D7)14)21WM)IEtu}u)70s/ – Full program.
)D7)14)21               – Push the literals 0, 7, 14, 21 onto the stack.
         WM     }       – Wrap the stack to a list and run each element on a separate
                          stack, collecting the results in a list.
           )IEt         – Crop the elements of the input before those indices.
               u        – Sum that list.
                 u      – Then sum the list of sums.
                  )70   – Push the literal 70 onto the stack.
                     s/ – Swap and divide.

JavaScript (Node.js), 49 bytes

a=>a.map((x,i)=>(I+=d=-~(i/7),s+=x*d),s=I=0)&&s/I

Try it online!


Non generics solution

JavaScript (Node.js), 39 36 bytes

a=>a.reduce((s,x,i)=>s+x*-~(i/7))/70

Try it online!

Haskell, 35 bytes

(/70).sum.zipWith(*)([1..]<*[1..7])

Bonus: if a,b,c,d are the weekly sums, normal average is the same as weighted average iff:

(a + b + c + d)/4 = (a + 2b + 3c + 4d)/10  <=>
10(a + b + c + d) = 4(a + 2b + 3c + 4d)    <=>
5(a + b + c + d)  = 2(a + 2b + 3c + 4d)    <=>
5a + 5b + 5c + 5d = 2a + 4b + 6c + 8d      <=>
3a + b - c - 3d   = 0

One solution is when first and last week have same sums, and likewise second and third weeks have the same sum, but there are infinitely many solutions if your biceps are up to it. Example: [15,10,10,10,10,10,5,20,20,20,25,25,20,20,30,20,20,20,20,20,20,10,10,20,0,10,10,10]

Try it online!

Python 3, 38 bytes

lambda x:sum(x+x[7:]+x[14:]+x[21:])/70

Try it online!

05AB1E, 8 7 bytes

Saved 1 byte thanks to Mr. Xcoder

7ô.s˜ÅA

Try it online!

Explanation

7ô         # split list into groups of 7
  .s       # push suffixes
    ˜      # flatten
     ÅA    # arithmetic mean

Husk, 6 bytes

AΣΣṫC7

Try it online!

Uses the trick Dennis used to outgolf my Jelly submission. Instead of repeating each chunk N times, it retrieves the suffixes of the list of chunks, which after flattening will yield the same result, except for the order.

Jelly, 7 bytes

s7ṫJFÆm

Try it online!

How it works

s7ṫJFÆm  Main link. Argument: A (array of length 28)

s7       Split the array into chunks of length 7.
   J     Indices; yield [1, ..., 28].
  ṫ      Tail; yield the 1st, ..., 28th suffix of the result to the left.
         Starting with the 5th, the suffixes are empty arrays.
    F    Flatten the resulting 2D array.
     Æm  Take the arithmetic mean.

Jelly, 9 bytes

s7x"J$FÆm

Try it online!

How it works

s7x"J$FÆm – Takes input from the first command line argument and outputs to STDOUT.
s7        – Split into groups of 7.
   "      – Apply vectorised (zipwith):
  x J$    – Repeat the elements of each list a number of times equal to the list's index.
      F   – Flatten.
       Æm – Arithmetic mean.