First hit the query, remove the single quotation marks from the valor
column, set an alias for the calculated field so that it is more readable to retrieve the values in php, if no nickname is specified, php will assume that 'name 'is the expression used in sum(valor)
or 0 (zero) if you use mysqli_fetch_array()
$consultar = "SELECT SUM('valor') FROM vendascalc WHERE valor";
Switch to:
$consultar = "SELECT SUM(valor) as total FROM vendascalc WHERE valor";
After mysqli_query()
retrieve the value of the query with mysqli_fetch_assoc()
and loop to get all rows returned by the query.
$resulta = mysqli_query($mysqli, $consultar);
while($item = mysqli_fetch_assoc($resulta)){
echo $item['total'] .'<br>';
}