Use Tags to Query Associated Multiple Posts and Get The Average Of Custom Field Values

If you use those custom fields only for the company tagged posts, then it’s sufficient to retrieve the custom fields without worrying about posts and tags:

$tags = array('Professional Rating', 'Efficiency Rating', 'Referral Rating');

foreach ($tags as $tag)
{
    $result = $wpdb->get_col( "SELECT meta_value FROM wp_postmeta WHERE meta_key = '$tag'" );

    $avg = empty($result) ? 0 : ( array_sum($result) / count($result) );

    echo "Average for $tag: $avg" . PHP_EOL;
}

This doesn’t check if the company posts are published or not.
For that use this query:

SELECT meta_value FROM wp_posts p, wp_postmeta pm
WHERE p.ID=pm.post_id AND p.post_status="publish" AND meta_key = '$tag'

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)