Index/Match with multiple criteria, but one is exact and other is largest without going over

mst3k4L

Board Regular
Joined
Nov 3, 2011
Messages
55
I have a table that looks like the one below with the dates sorted in descending order.

[table="width: 500"]
[tr]
[td]Person[/td]
[td]Date[/td]
[td]Number[/td]
[/tr]
[tr]
[td]Jose[/td]
[td]1/1/2014[/td]
[td]98[/td]
[/tr]
[tr]
[td]Rosa[/td]
[td]5/14/14[/td]
[td]47[/td]
[/tr]
[tr]
[td]Jose[/td]
[td]6/1/14[/td]
[td]3[/td]
[/tr]
[tr]
[td]Rosa[/td]
[td]2/1/15[/td]
[td]456[/td]
[/tr]
[tr]
[td]Jose[/td]
[td]12/5/15[/td]
[td]3[/td]
[/tr]
[tr]
[td]Rosa[/td]
[td]5/2/16[/td]
[td]-10[/td]
[/tr]
[/table]


I want to enter a name and date and have excel search the table for the exact name and the closest date without going over, and then provide the answer in the "Number" column. For example, entering "Rosa" and "6/2/14" will result in "47", while "Jose" and "6/2/14" will be "3".

I'm assuming it's some combination of Index & Match. Feel free to use something else, but please void VBA if possible. I can resort the table as needed. Thanks in advance!
 
This actually works!
Good "starting" point ;-)
Well, not sure at all it grabs the 1st... Take the same example with Jose and 1/1/16 and before validating change the value of 3 for i.e 100 on the line where Jose has date 12/5/15. What does the formula return?
 
Upvote 0
Good "starting" point ;-)
Well, not sure at all it grabs the 1st... Take the same example with Jose and 1/1/16 and before validating change the value of 3 for i.e 100 on the line where Jose has date 12/5/15. What does the formula return?
It's working now, but I'm not sure what I did differently. Thanks for the help!
 
Upvote 0

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