Multi criteria lookup

Ronnet2

Board Regular
Joined
Sep 13, 2015
Messages
52
Hi,

I'm looking for a formula to provide me the answer to a multi-criteria lookup on a set range.

The range looks like this:

COLUMN A_____COLUMN B
01-01-15______0
02-01-15______1
03-01-15______0
04-01-15______2
05-01-15______1
06-01-15______0
07-01-15______2
08-01-15______1
09-01-15______0
10-01-15______2
11-01-15______1
12-01-15______0

The first criteria is a date (e.g. 05-01-15), as see in column A, the second criteria is value (e.g. 2), as seen in column B. For example, I wish to find the first date that is >=05-01-15 and has a value >= 2. In the given range the answer be 07-01-15.

I'm trying to make the following formula work for me:

=LOOKUP(2;1/(--(A:A>=D1)*--(B:B>=D2));A:A)

With D1: 05-01-15
With D2: 2

However, it is succesful in locating the last date that matches the multi criteria. In the example this is 10-01-15. So it does recognize a date that corresponds with a value of 2, but it starts the search 'bottom-up' instead of 'top-down'. Anyone know how to improve the formula or have a better alternative? I prefer a formula that isnt very resource demanding as the formula will be copy/pasted down a lot. Thank you.
 
Last edited:
I'm not sure if I understand the question, but both criteria are '>='. So if I'm looking for the first date that matches ''>=2-1-2015' and '4' and by coincidence '2-1-15' happens to have a '4' then the answer should be '2-1-2015'. Only if 2-1-2015 has a 3 or lower should the formula start looking for the first date that has '>=4' and return this date as the answer.


Post #6, which is a re-post of your sample in post #1, contains no 4 in the B-range...
 
Upvote 0

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Post #6, which is a re-post of your sample in post #1, contains no 4 in the B-range...

Sorry that it wasnt clear, columm B can go up quite high. The set is just an example. Here is another example of what could be the content of column B:

0
0
1
0
2
1
0
10
9
8
7
6
5
4
3
2
1
0
5
4
3
2
1
0
2
1
0
2
1
0

So if Im looking for >=10 then there is only one 'date' that matches this, which belongs to the 8th value in column B. If I'm looking for >=5 then there are two options. Andd for >=2 then there are many more options.
 
Upvote 0

Forum statistics

Threads
1,215,446
Messages
6,124,900
Members
449,194
Latest member
JayEggleton

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