Excel Lookup function

Cgeisler

New Member
Joined
Sep 15, 2015
Messages
2
Hello, I am looking to derive a value based on a variable data set. I want take the date that is chosen and find that value in Column C then look to Column E's # that is chosen and give me the value from Column C that is that # (in this case 1) day prior to the Date I entered. Another kicker is that it cant be a weekend, so it would need to skip over all dates that in column D are labeled 1 or 7. For this example, the value the formula should have chosen is 1/9/15. Any ideas? Thank you:p

Date:01/12/2015
Column AColumn BColumn CColumn DColumn E
1= Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thursday, 6=Friday,7=SaturdayDays Prior
Day of Week1
9/7/20151/1/20151/1/20155
10/12/20151/2/20151/2/20156
11/11/20151/3/20151/3/20157
11/26/20151/4/20151/4/20151
12/25/20151/5/20151/5/20152
1/1/20161/6/20151/6/20153
1/18/20161/7/20151/7/20154
2/15/20161/8/20151/8/20155
5/30/20161/9/20151/9/20156
7/4/20161/10/20151/10/20157
9/5/20161/11/20151/11/20151
10/10/20161/12/20151/12/20152
11/11/20161/13/20151/13/20153
11/24/20161/14/20151/14/20154
12/26/20161/15/20151/15/20155
1/2/20171/16/20151/16/20156
1/16/20171/17/20151/17/20157
2/20/20171/18/20151/18/20151
5/29/20171/19/20151/19/20152
7/4/20171/20/20151/20/20153
9/4/20171/21/20151/21/20154
10/9/20171/22/20151/22/20155
11/23/20171/23/20151/23/20156
12/25/20171/24/20151/24/20157
1/1/20181/25/20151/25/20151
1/15/20181/26/20151/26/20152
2/19/20181/27/20151/27/20153
5/28/20181/28/20151/28/20154
7/4/20181/29/20151/29/20155
9/3/20181/30/20151/30/20156
10/8/20181/31/20151/31/20157
11/12/20182/1/20152/1/20151
11/22/20182/2/20152/2/20152
12/25/20182/3/20152/3/20153
1/1/20192/4/20152/4/20154
1/21/20192/5/20152/5/20155
2/18/20192/6/20152/6/20156
5/27/20192/7/20152/7/20157
7/4/20192/8/20152/8/20151
9/2/20192/9/20152/9/20152
10/14/20192/10/20152/10/20153
11/11/20192/11/20152/11/20154
11/28/20192/12/20152/12/20155
12/25/20192/13/20152/13/20156
1/1/20202/14/20152/14/20157
1/20/20202/15/20152/15/20151
2/17/20202/16/20152/16/20152
5/25/20202/17/20152/17/20153

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

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi,

I could do this after adding a helper column:

You have dates in Column A, B & C. Column D contains numbers.


Add a new helper Column E, In E2:
=ROW(C2)
drag this down till the last cell in the data range


Lookup value in H7: 01/12/2015
try the following formula in H8:
Code:
=INDEX(C$1:C$49,LARGE(IF((E$1:E$49<MATCH($H$7,C$1:C$49,0))*(D$1:D$49<>1)*(D$1:D$49<>7),ROW($C$1:$C$49)),ROW($A$1)))

=INDEX(C$1:C$49,LARGE(IF((E$1:E$49<MATCH($H$7,C$1:C$49,0))*(D$1:D$49<>1)*(D$1:D$49<>7),ROW($C$1:$C$49)),ROW($A$1)))

This needs to be array entered (to be confirmed by pressing CTRL+SHIFT+ENTER)

PM me your e-mail address if you want the sample file that I created for you!
 
Last edited:
Upvote 0
For some strange reasons I guess the system is auto correcting my formula. The actual formula is different than what I posted in the above thread. I did it twice - once with code tags and again without the code tags. Strange!!
 
Upvote 0
OK, tweaked the above formula provided and it works now. Thank you for your help CBatrody. The formula that worked is as follows:

INDEX(D$11:D$27768,SMALL(IF((E$11:E$27768>MATCH($D$4,D$11:D$27768,0))*(F$11:F$27768<>1)*(F$11:F$27768<>7),ROW($D$11:$D$27768)-10),$B6))
 
Upvote 0

Forum statistics

Threads
1,215,055
Messages
6,122,902
Members
449,097
Latest member
dbomb1414

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