Finding the last match in a list

rowett

Board Regular
Joined
Jun 10, 2002
Messages
116
I want to be able to find the last match in a list. To find the first match I use the MATCH worksheet function. For example MATCH("Chris", A1:A5, 0) finds the index of the first cell in the range A1:A5 containing the text "Chris".

How do I find the LAST cell in the range that contains "Chris"?

Many thanks,
Chris
 
I've been trying this for over an hour with MAX(IF()), which worked on one worksheet but not another, INDEX(MATCH()), LOOKUP()....you name it. Nothing worked but INDEX(SUMPRODUCT()) is perfect!

Perfect for what? Could you post a sample along with the desired result?
 
Upvote 0

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Perfect for what? Could you post a sample along with the desired result?

I was trying to create a summary page for car maintenance log. Here is the result:
Code:
=INDEX(maint_data[#All],SUMPRODUCT(MAX((maint_data[Maintenance Type]=A17)*(ROW(maint_data[Maintenance Type])))),3)

The summary page has a list of maintenance types (oil change, tire rotation, brake inspection, etc.). On the maintenance page, I keep a running log of all maintenance actions. The summary page then displays when the last action of the type was, and calculates when the next one is due based on my manual's recommended cycle.
 
Upvote 0
@ soccerkingpilot

Could you post 10 rows from this table (with headers included) along with the desired result for that bit of 10 rows?
 
Upvote 0
@ soccerkingpilot

Could you post 10 rows from this table (with headers included) along with the desired result for that bit of 10 rows?

SUMMARY TABLE:
Maintenance CyclesScheduleLast ServiceNext Service
Air Filter 12,00018,890 30,890
Oil Change 6,00018,890 24,890
Tire Rotation 6,00013,397 19,397
Cabin Air Filter 12,00014,100 26,100
Brake Inspection 12,00013,397 25,397

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>

MAINTENANCE DATA:
DateMaintenance TypeOdometer
01-Jul-18Oil Change6,954
03-Jul-18Tire Rotation7,015
08-Sep-18Oil Change13,019
16-Sep-18Engine Air Filter Change13,235
05-Oct-18Tire Rotation13,397
05-Oct-18Brake Inspection13,397
28-Oct-18Cabin Air Filter14,100
18-Jan-19Oil Change18,890

<colgroup><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
That's the engine air filter.


Book1
ABCDEFGHI
1DateMaintenance TypeOdometerMaintenance CyclesScheduleLast ServiceNext Service
21-Jul-18Oil Change6,954Engine Air Filter12,00013,23525,235
33-Jul-18Tire Rotation7,015Oil Change6,00018,89024,890
48-Sep-18Oil Change13,019Tire Rotation6,00013,39719,397
516-Sep-18Engine Air Filter Change13,235Cabin Air Filter12,00014,10026,100
65-Oct-18Tire Rotation13,397Brake Inspection12,00013,39725,397
75-Oct-18Brake Inspection13,397
828-Oct-18Cabin Air Filter14,100
918-Jan-19Oil Change18,890
Sheet1


In H2 enter and copy down:

=LOOKUP(9.99999999999999E+307,SEARCH(F2,maint_data[Maintenance Type]),maint_data[Odometer])
 
Upvote 0

Forum statistics

Threads
1,215,467
Messages
6,124,985
Members
449,201
Latest member
Lunzwe73

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