help with lookup value between dates range

stzruya

New Member
Joined
Mar 8, 2018
Messages
8
Hi,
I need to lookup value in table and return value based on date range.
my table look like that:

[TABLE="width: 320"]
<colgroup><col><col><col><col></colgroup><tbody>[TR]
[TD="align: left"]Number[/TD]
[TD="align: left"]Date1[/TD]
[TD="align: left"]Date2[/TD]
[TD="align: left"] Model[/TD]
[/TR]
[TR]
[TD="align: right"]109[/TD]
[TD="align: right"]02/12/2003[/TD]
[TD="align: right"]29/07/2005 [/TD]
[TD="align: left"] A[/TD]
[/TR]
[TR]
[TD="align: right"]109[/TD]
[TD="align: right"]29/07/2005[/TD]
[TD="align: right"]23/11/2009[/TD]
[TD="align: left"] B[/TD]
[/TR]
[TR]
[TD="align: right"]109[/TD]
[TD="align: right"]23/11/2009[/TD]
[TD="align: right"]11/11/2010[/TD]
[TD="align: left"] C[/TD]
[/TR]
[TR]
[TD="align: right"]109[/TD]
[TD="align: right"]11/11/2010[/TD]
[TD="align: right"]19/12/2010[/TD]
[TD="align: left"] D[/TD]
[/TR]
[TR]
[TD="align: right"]109[/TD]
[TD="align: right"]19/12/2010[/TD]
[TD="align: right"]25/04/2013[/TD]
[TD="align: left"] E[/TD]
[/TR]
[TR]
[TD="align: right"]109[/TD]
[TD="align: right"]25/04/2013[/TD]
[TD="align: right"]24/03/2015[/TD]
[TD="align: left"] F[/TD]
[/TR]
[TR]
[TD="align: right"]109[/TD]
[TD="align: right"]24/03/2015[/TD]
[TD="align: right"]28/12/2050[/TD]
[TD="align: left"] G[/TD]
[/TR]
[TR]
[TD="align: right"]110[/TD]
[TD="align: right"]02/12/2003[/TD]
[TD="align: right"]29/07/2005[/TD]
[TD="align: left"] A[/TD]
[/TR]
[TR]
[TD="align: right"]110[/TD]
[TD="align: right"]29/07/2005[/TD]
[TD="align: right"]23/12/2009[/TD]
[TD="align: left"] B[/TD]
[/TR]
[TR]
[TD="align: right"]110[/TD]
[TD="align: right"]23/12/2009[/TD]
[TD="align: right"]02/11/2010[/TD]
[TD="align: left"] C[/TD]
[/TR]
[TR]
[TD="align: right"]110[/TD]
[TD="align: right"]02/11/2010[/TD]
[TD="align: right"]19/12/2010[/TD]
[TD="align: left"] D[/TD]
[/TR]
[TR]
[TD="align: right"]110[/TD]
[TD="align: right"]19/12/2010[/TD]
[TD="align: right"]21/03/2013[/TD]
[TD="align: left"] E[/TD]
[/TR]
[TR]
[TD="align: right"]110[/TD]
[TD="align: right"]21/03/2013[/TD]
[TD="align: right"]24/03/2015[/TD]
[TD="align: left"] F[/TD]
[/TR]
[TR]
[TD="align: right"]110[/TD]
[TD="align: right"]24/03/2015[/TD]
[TD="align: right"]20/05/2015[/TD]
[TD="align: left"] G[/TD]
[/TR]
[TR]
[TD="align: right"]110[/TD]
[TD="align: right"]20/05/2015[/TD]
[TD="align: right"]26/05/2015[/TD]
[TD="align: left"] H[/TD]
[/TR]
[TR]
[TD="align: right"]110[/TD]
[TD="align: right"]26/05/2015[/TD]
[TD="align: right"]28/12/2050[/TD]
[TD="align: left"] J[/TD]
[/TR]
[TR]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: left"][/TD]
[/TR]
</tbody>[/TABLE]
In other sheet i have list of numbers such as the numbers above (in column A) with specific date, based on that i need to return the model that was between that time.
for example for number 110 in the date 1/1/2010 the model was C.

is there any function that can do that or even macro that can help in that case.

thank you in advance

Samuel
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Excel 2010
ABCDEFGHI
1NumberDate1Date2Model
210912/2/20037/29/2005A
31097/29/200511/23/2009B1101/1/2010C
410911/23/200911/11/2010C
510911/11/201012/19/2010D
610912/19/20104/25/2013E
71094/25/20133/24/2015F
81093/24/201512/28/2050G
911012/2/20037/29/2005A
101107/29/200512/23/2009B
1111012/23/200911/2/2010C
1211011/2/201012/19/2010D
1311012/19/20103/21/2013E
141103/21/20133/24/2015F
151103/24/20155/20/2015G
161105/20/20155/26/2015H
171105/26/201512/28/2050J
Sheet1
Cell Formulas
RangeFormula
I3{=INDEX($D$2:$D$17,MATCH(G3,IF($B$2:$B$17<=H3,IF($C$2:$C$17>=H3,$A$2:$A$17))))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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