Finding the current duplicate record

Stan Dad

New Member
Joined
Aug 17, 2012
Messages
21
I have a spreadsheet to track events (servicing, repairs, fuelling, etc) for my car - dates in Col A, events in B, mileage in C, prices in D.

I want to return the mileage when the next service is due, based on the mileage of the last service. Using VLOOKUP set to FALSE returns the first service mileage; set to TRUE, it returns random values. The events in Col B repeat in a random order (e.g. fuel, fuel, service, fuel, repairs, fuel, fuel, service).

All help appreciated.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
can you please provide some data? so we understand more of what your wanting

Here is an extract from the spreadsheet:
DateEventMileageCost
29/1/13Fuel6130977.68
30/1/13Service61312230.15
9/2/13Fuel6186477.08
14/2/13Repairs6244721.19
15/2/13Fuel6244876.60

<tbody>
</tbody>
Each of the scheduled events repeats several times, and I want to return the mileage of the last occurrence of the service event. Using VLOOKUP will only return the first occurrence of that event if set to FALSE, and an irrelevant value if set to TRUE.
 
Upvote 0
F GHIJKL
2Event lookupcount DateEventMileageCost
3fuel3 15/2/13Fuel6244876.6

<colgroup><col width="64" span="8" style="width:48pt"> </colgroup><tbody>
</tbody>
I USED =INDEX(A3:D7,LARGE(IF($B$3:$B$7=$F$3,ROW($B$3:$B$7)-ROW($B$3)+1),1),MATCH(I2,A2:D2,0)) BUT i SET UP THE EVENT LOOK UP TO THE left there and when you type Fuel in there I will look up the last one, same with repairs or what ever you type in there, this is assuming that you have your data starting in A3
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,200
Members
449,072
Latest member
DW Draft

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