If a date in a cell is between two dates in a table retrieve the right value/text

nunomd

New Member
Joined
Sep 1, 2011
Messages
16
Hi everyone,
I hope you could help me out with this question:
I would like to have the formula to insert in the cell F2, F3 and F4. If the date in cell E2 is between dates in A and B column should retrieve the right value/text in column C (to cell F2). The same for dates in cell E3, E4 and E5.
Thank you so much.

[TABLE="class: grid, width: 500, align: center"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]From[/TD]
[TD]To[/TD]
[TD]PW[/TD]
[TD][/TD]
[TD]Dates[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][TABLE="width: 187"]
<colgroup><col span="2"><col></colgroup><tbody>[TR]
[TD]16/01/2015[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 187"]
<tbody>[TR]
[TD]15/05/2015
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]PW1[/TD]
[TD][/TD]
[TD]17/01/2015[/TD]
[TD]PW1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][TABLE="width: 187"]
<tbody>[TR]
[TD]16/05/2015
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][TABLE="width: 187"]
<tbody>[TR]
[TD]31/05/2015
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]PW2[/TD]
[TD][/TD]
[TD]18/01/2015[/TD]
[TD]PW1[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]19/01/2015[/TD]
[TD]PW1[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]19/05/2015[/TD]
[TD]PW2[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
in F2 and copy down

=IF(AND(G2>=A2,G2<=D2),E2,"")
 
Upvote 0
Didn´t work. Maybe I didn´t explained myself right. The text in red is what I want to achieve with the formula. The dates in column E must "read" the table between A2 to B3 (and if they fill the condition retrieve text in column and not only by line 2 as you suggested. Thank you.
 
Upvote 0
may be this

=IF(AND(G2>=$A$2,G2<=$D$2),$E$2,IF(AND(G2>=$A$3,G2<=$D$3),$E$3,""))
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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