if you need access other fields in your field template, you can access them by
<?
echo $row->{$view->field['FIELD_ID']->field_alias};
?>
You will be able to add some logic to your template like
<?
if($row->{$view->field[field_B_value]->field_alias})
{
echo $output  ;
}
else
{
echo “B is not available”;
}
?>
Note the ‘FIELD_ID’ can be something different depending on the field type. it can be “field_B_nid” (if it is node reference), or “field_B_value” [...]