Vlookup date range and result based on criteria

rahmit

New Member
Joined
Jul 23, 2018
Messages
1
Dear friends,

I required your help for the below excel query:

The following is the data set sample:

Class. Date Reg.No Course
12/05/2017 123456 ?
19/05/2017123456?
30/05/2017123456?
02/06/2017901999?
09/06/2017901999?
16/06/2017901999?
23/06/2017901999?

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

I require the course name based if two criteria are met:
a) Reg no
b) Data range is within category from the below data set:


Reg no From To Course
123456 1/05/2017 26/05/2017 Maths
123456 27/05/2017 31/05/2017 Geography
901999 1/05/2017 15/06/2017 Science
901999 16/06/2017 30/06/2017 History

Based on the below, the final data set with course name should be as follows:

Class. Date Reg.No Course
12/05/2017 123456Maths
19/05/2017123456Maths
30/05/2017123456 Geography
02/06/2017901999Science
09/06/2017901999Science
16/06/2017901999History
23/06/2017901999History


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

Hope its clear. Thanks
Rahmit
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Book1
ABCD
1Reg noFromToCourse
21234562017-05-012017-05-26Maths
31234562017-05-272017-05-31Geography
49019992017-05-012017-06-15Science
59019992017-06-162017-06-30History
Sheet1



Book1
ABC
1Class. DateReg.NoCourse
22017-05-12123456Maths
32017-05-19123456Maths
42017-05-30123456Geography
52017-06-02901999Science
62017-06-09901999Science
72017-06-16901999History
82017-06-23901999History
Sheet2


In C2 of Sheet2 control+shift+enter, not just enter, and copy down:

=INDEX(Sheet1!$D$2:$D$5,MATCH(B2,IF(A2>=Sheet1!$B$2:$B$5,IF(A2<=Sheet1!$C$2:$C$5,Sheet1!$A$2:$A$5)),0))
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,120
Members
451,399
Latest member
alchavar

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