Using previously populated cell on a past worksheet.

gawa_ram

New Member
Joined
May 14, 2011
Messages
7
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.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
To find the last filled cell try like this

Excel Workbook
ABCDEFGHIJK
1137522
Sheet3
 
Upvote 0
Thanks VoG - would this work looking back through worksheets though for populated K3 cell on each sheet if you get what I mean?

Thanks again.
 
Upvote 0
No problem VoG - I need the formula to look through the worksheets and find the last populated cell of K3-140ish every time and use that to work out the MPG the next time the driver fills up.

If anyone can help it would be much appreciated.
 
Upvote 0
I've now amended the spreadsheet so VoG's above formula would work.

However when I input the LOOKUP formula I require each cell to look into three cells above it and on above to the 1st of the month to see what was the last drawing.

For example:

A driver has drawn fuel on 1st month then doesn't do so until 10th of the month. As drivers can draw up to three times in one day there is an area of 3x31 (days of the month) cells allowed for drawings from I6-K36. Therefore, I need the LOOKUP to look-up I6-K14 (1st-9th) to see when the last drawing was made and use that to work out the MPG for those 10 days of the month.

The LOOKUP I have entered from above, returns a DIV/0 figure as K14 is blank and it won't pick up I6.

Can anyone help with this problem? This will complete the spreadsheet for me!!

Many thanks.
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,875
Members
452,949
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top