thanks for the quick replies

Try this formula

Formula:
=SUM(IF(C5="",0,INDIRECT("B"&LARGE(IF($C$1:C4<>"",ROW($C$1:C4)),1)+1&":B"&ROW()))) entered with ctrl+shift+enter
Sorry but you have completly lost me here


Should column D not be working out miles per litre (BxC)?
No as that is worked out in another colum but in order for that calc to work I need the answer from colum D ie the total amount of litres that has been added

colum D has to work out how many litres has been put in since the miles was recorded last as per the the attachment


if the litre's and miles are recorded in every row then the calcs would work fine with no problems

But like in the attachment the miles will not be added in every row and thats where the probs start

When the miles are not added in each row I need the litres in all the previous rows (up to the row where the mile were last added) to add up, and thats what I can't make happen automatically

hope that makes sense

I will make up a dummy sheet with actual entries and attach it to see if that clears up the confusion as to what I need

Thanks

Gordon