Hello,

I have a spreadsheet which I developed as a Log Book for my vehicle where I enter all costs incurred including cost of fuel and cost per litre when it was purchased.
I have columns for Date, Odometer, Trip, Total cost, Cost per litre plus fuel usage (calculated) -
I have a column which calculates litre used per 100 kilometers (L/100km) for each separate purchase which works fine.

I would like to add a column which automatically calculates average fuel usage since the log book commenced.
I have used =SUM(a1:a2)/(SUM(b1:b2)/100) which works until it encounters a cell in a column (column a and/or b) which is blank which can happen when I record a cost which was NOT fuel and then it returns "divide by zero" which I feel is because it is attempting to add a value for a blank cell. I think I need to use IF but not sure how to.

Could someone please advise how I can modify my formula to work.

Thanks