Index and Match query?

Chris2022

New Member
Joined
Apr 25, 2022
Messages
4
Office Version
  1. 2016
Platform
  1. Windows
Hello everyone, I have a table that lists maximum time behind the wheel each day for truck drivers, depending on their individual tour. What I am trying to do is this: if a particular driver starts today at a particular time, I want to enter what I would believe to be an index and match query, to find the maximum hours they can spend behind the wheel each day, depending on how many days their current tour is. As an example, driver A starts today at 15:45, and has a 3 day tour, in the table, this is a starting time between 15:30 and 15:59, then moving across that row, find the 3 day column to get the answer of "Not allowed". All suggestions greatly appreciated. Unable to use XL2BB, find sample photo attached
DFMS.png
.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
With H2 and I2 is time and date criteria, try in J2:
VBA Code:
=LOOKUP(H2,$A$2:$A$12,INDEX($C$2:$F$12,,MATCH(I2,$C$1:$F$1,0)))
Capture.PNG
 
Upvote 0
Solution

Forum statistics

Threads
1,214,920
Messages
6,122,272
Members
449,075
Latest member
staticfluids

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