INDEX MATCH lookup if between two times

DDT~123

Board Regular
Joined
May 31, 2012
Messages
220
Hello All,

I have the below formula which works if the lookup value is BETWEEN a minimum and maximum value but doesn't work if the value is EQUAL TO a minimum value.


{=IFERROR(INDEX(Goals!$A$12:$A$16,MATCH(1,(E9<=Goals!$D$12:$D$16)*(E9>=Goals!$C$12:$C$16),0)),"")}


Goals!$A$12:$A$16 - This is the range that i want to be output (numeric value)
E9 - The value that i want to lookup (time value)
Goals!$D$12:$D$16 - This is the range which has the maximum values (time value)
Goals!$C$12:$C$16 - This range includes the minimum values (time value)


These are the values i have in Goals!$C$12:$D$16
MinMax
0:08:022:00:00
0:07:410:08:01
0:07:200:07:40
0:06:590:07:19
0:00:010:06:58

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


I'm receiving an error when the lookup value in E9 is 0:08:02


Any help would be greatly appreciated.
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
That would produce whatever is in Goals!A12 as written. Check to see what this produces =E9=C12
 
Upvote 0
So what does =E9=C12 produce? Just paste it into a cell in the goals sheet.
 
Upvote 0
Then the value in C12 is probably greater than "0:08:02". Lets try this =ISNUMBER(C12). What does that produce?
 
Upvote 0
Ok so you have true numbers for your times. Your formula is doing what you are asking it. Its just that E9>=Goals!$C$12 produces false so in other words C12 is greater than E9. C12 probably has either a date component or some milliseconds. This formula could confirm which:

=TIME(HOUR(C12),MINUTE(C12),SECOND(C12))=C12
 
Upvote 0
Ok so you have true numbers for your times. Your formula is doing what you are asking it. Its just that E9>=Goals!$C$12 produces false so in other words C12 is greater than E9. C12 probably has either a date component or some milliseconds. This formula could confirm which:

=TIME(HOUR(C12),MINUTE(C12),SECOND(C12))=C12

You're good! This returned as FALSE
 
Upvote 0
Then you have milliseconds in C12 i believe. Try retyping it into the cell and you should see your formula produce a result rather than an error (blank)
 
Upvote 0

Forum statistics

Threads
1,215,374
Messages
6,124,567
Members
449,171
Latest member
jominadeo

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