Calculate average value while excluding empty fields