Guys,
I'm constructing a spreadsheet for work and need one final calculation before it is complete.
The spreadsheet is working out the MPG for vehicles on a day-by-day basis before giving an overall monthly total at the end. The work sheets at the bottom represent each day of the month.
The sheets themselves are all the same and sorted by Unit number so each cell on each spreadsheet will represent the same unit.
I have the MPG calculation filled in so that it will use the amount of fuel drawn the previous day divided by the miles travelled.
However, not all drivers fill up every day and so if a driver say fills up on the 1st then doesn't fill up again to the 7th, the formula is looking for a fill on the 6th so it can work out the MPG. Obviously this will be blank so no MPG will be calculated.
Is there anyway I can get Excel to look back and pick up the last populated cell in that row and use that for the calculation? In the above example, it will ignore the 2nd-6th and will recognise a fuel-up on the 1st and use that drawing?
Many thanks for your help.
I'm constructing a spreadsheet for work and need one final calculation before it is complete.
The spreadsheet is working out the MPG for vehicles on a day-by-day basis before giving an overall monthly total at the end. The work sheets at the bottom represent each day of the month.
The sheets themselves are all the same and sorted by Unit number so each cell on each spreadsheet will represent the same unit.
I have the MPG calculation filled in so that it will use the amount of fuel drawn the previous day divided by the miles travelled.
However, not all drivers fill up every day and so if a driver say fills up on the 1st then doesn't fill up again to the 7th, the formula is looking for a fill on the 6th so it can work out the MPG. Obviously this will be blank so no MPG will be calculated.
Is there anyway I can get Excel to look back and pick up the last populated cell in that row and use that for the calculation? In the above example, it will ignore the 2nd-6th and will recognise a fuel-up on the 1st and use that drawing?
Many thanks for your help.