LOOKUP() multiple criteria, return most recent value

Dauch

New Member
Joined
Apr 17, 2019
Messages
3
ABCD
NAMEDOIDeptOSHA
John3/8/2019GroceryYes
Isa3/19/2019PerishableNo
Dave3/24/2019GroceryNo
Phil3/25/2019PerishableNo
Eric3/26/2019PerishableYes
Anne3/28/2019GroceryYes
Jack4/1/2019PerishableYes

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


So, I've been scouring the boards for quite some time and I can't seem to process how to get this formula to work. I have my sheet set up so I can find the last injury (DOI) for each Department (Dept). I cannot manage to incorporate a second criteria that will limit the results to (OSHA = Yes), however.

What I am trying to accomplish is to look (in a much, much bigger file) at the dates of injuries and return the last injury for each Department, only when it is an OSHA incident. The formula that worked to get all but the OSHA perspective is:

=LOOKUP(2,1/('[Book1]Injuries '!$D:$D="Grocery"),'[Book1]Injuries '!$B:$B)

Some sensitive info within the workbooks, so I apologize for some of the strange references, but assume Book1 is the workbook and the sheet name Injuries, accordingly.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Hello,

For a large database, you can make your life easier ... by inserting a Pivot Table ...

Hope this will help
 
Upvote 0
Sorry, I should have clarified that a bit. I'm trying to get the formula set up so that it can be copied into a powerpoint that runs in the facility -- basically trying to give a nice graphic of how long it has been since we have had an incident/injury. That part is good to go, just can't make it also look at the OSHA column...
 
Upvote 0
Try this:

=LOOKUP(2,1/(('[Book1]Injuries '!$C:$C="Grocery")*('[Book1]Injuries '!$D:$D="Yes")),'[Book1]Injuries '!$B:$B)
 
Upvote 0
You could also try this:
Code:
=MAXIFS([COLOR=#008000][FONT=Verdana]'[Book1]Injuries'[/FONT][/COLOR]!B:B,[COLOR=#008000][FONT=Verdana]'[Book1]Injuries'[/FONT][/COLOR]!C:C,"Grocery",[COLOR=#008000][FONT=Verdana]'[Book1]Injuries'[/FONT][/COLOR]!D:D,"Yes")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,972
Members
448,537
Latest member
Et_Cetera

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