I have the formula =SUM(IF(MONTH(gas!$A$5:$A$200)=B$1,IF(YEAR(gas!$A$5:$A$200)=$A4,gas!$E$5:$E$200,0))) in B4 and filled across to M4, I have =SUM(B4:M4) in N4 to give me the totals, all of this works fine, I want to get the average, but if I use = AVERAGE(B4:M4) it averages all 12 columns even if there is no data in them yet, is there a way to average only the columns that have data in them?