Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Mileage and MPG for Fleet Calculation

I have a table in Excel that looks something like this:

Date Truck Name Gallons Price
7/31 Truck 1 12.345 2.869
7/31 Truck 2 11.255 2.869
7/31 Truck 3 10.587 2.869
8/3 Truck 1 11.256 2.879
8/3 Truck 2 12.854 2.859
8/4 Truck 1 10.857 2.879
8/4 Truck 3 17.588 2.879

I need to add a 5th column called Previous Fillup.
In this new column I need it to figure out the date of the last fill up for
that particular truck.

Any suggestions?
Thanks in advance...

Scott


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default Mileage and MPG for Fleet Calculation

Try this:

E1: PrevDate

E2: =INDEX($A$1:$A2,LARGE(INDEX(($B$1:$B1=B2)*ROW($B$1 :$B1),0),1))
Copy E2 down as far as you need

Is that something you can work with?
***********
Regards,
Ron

XL2003, WinXP


"Scott Campbell" wrote:

I have a table in Excel that looks something like this:

Date Truck Name Gallons Price
7/31 Truck 1 12.345 2.869
7/31 Truck 2 11.255 2.869
7/31 Truck 3 10.587 2.869
8/3 Truck 1 11.256 2.879
8/3 Truck 2 12.854 2.859
8/4 Truck 1 10.857 2.879
8/4 Truck 3 17.588 2.879

I need to add a 5th column called Previous Fillup.
In this new column I need it to figure out the date of the last fill up for
that particular truck.

Any suggestions?
Thanks in advance...

Scott


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Mileage and MPG for Fleet Calculation

Add this to E3 and copy down

=IF(MAX(IF($B$2:B2=B3,ROW($B$2:B2)))0,INDEX($C$2: $C$8,MAX(IF($B$2:B2=B3,ROW($B$2:B2)))-MIN(ROW($B$2:B2))+1),"")which is an array formula, it should be committed with Ctrl-Shift-Enter, notjust Enter.Excel will automatically enclose the formula in braces (curly brackets), donot try to do this manually.When editing the formula, it must again be array-entered.-----HTHBob(there's no email, no snail mail, but somewhere should be gmail in my addy)"Scott Campbell" wrote in ...I have a table in Excel that looks something like this: Date Truck Name Gallons Price 7/31 Truck 1 12.345 2.869 7/31 Truck 2 11.255 2.869 7/31 Truck 3 10.587 2.869 8/3 Truck 1 11.256 2.879 8/3 Truck 2 12.854 2.859 8/4 Truck 1 10.857 2.879 8/4 Truck 3 17.588 2.879 I need to add a 5th column called Previous Fillup. In this new column I need it to figure out the date of the last fill upfor that particular truck. Any suggestions? Thanks in advance... Scott

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
need a excel spreadsheet for fleet maintenance - with formulas RJL Excel Discussion (Misc queries) 2 April 4th 23 11:20 AM
I'm using the mileage log., How do I total all the mileage? ricaislandgirl New Users to Excel 2 April 2nd 07 11:35 PM
Mileage Calculation Cathy Landry Excel Worksheet Functions 5 December 7th 05 08:30 PM
Mileage calculation Hardy03 Excel Discussion (Misc queries) 2 August 30th 05 12:32 PM
vehicle fleet maintenance diggy Excel Worksheet Functions 3 May 15th 05 05:29 PM


All times are GMT +1. The time now is 04:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"