 <p>Get it as </p> <pre><code>$total = 0 $avg = 0 foreach ($users as $user) { $user_avg = ($user['reliable'] + $user['communication'] + ($user['experience']/3) * 5) / 3; $total += $user_avg; } if (sizeof($users) &gt; 0) { $avg = $total/sizeof($users); $avg = round($avg, 2) } </code></pre>