In your example you combine full type of IF-operator with simple type of else, so it can raise such error with "echo" operator. Try to use full form of if-else operator.
<?php
if ( ($housetotal > $auctionDetails['a1'])&&($housetotal < $auctionDetails['a4']) && ($auctionDetails['a1'] !=0))
{
$sold=$housetotal-$auctionDetails['a1'];
echo $sold;
echo "Houses Sold";
}
else{
echo "No houses have been sold yet";
}
?>
In other cases only right idea I have it is string type of $auctionDetails['a1']...