Conditional Lookup? prt2

uberathlete

Board Regular
Joined
Jul 11, 2007
Messages
117
Hi everyone, I need some help. I posed a similar question 2 days ago (http://www.mrexcel.com/board2/viewtopic.php?t=284838&highlight=) but this one's a bit different. Here's the situation (please refer to image):

6c3397p.jpg



Basically, I would like to fill column F. The values in column F2 must be those prices that occured at 8:25:00 on the corresponding date specified in column E. However, when there is no 8:25:00 price , then price of the the same date at the hour closest to but beyond 8:25:00 must be used instead and this value should be highlighted.

So in this case, cell F requires the 8:25:00 price on January 1, 2000 which would be 78.45 coming from cell C3. For cell F4, there is no 8:25:00 price on January 5, 2000 so instead it should have the price on the same date at the hour closest to but beyond 8:25:00 which is 99.99 (occuring at 9:10:00) and must be highlighted as well.

Anyone know how I could do this? Oh also, for my earlier question (please see link above), the suggestion by Domenic worked great but there was no highlighting that occured. So I'd like to modify the formula he suggested to accomodate this feature, if it's possible.

Any suggestions would be greatly appreciated. Thank you!
 
Hi uberathlete:

This is what I came up with ...
Book3
ABCDEF
1DateTimePriceDatePrice
21/2/20008:00:2099.31/2/200078.45
31/2/20008:25:0078.451/3/200054.54
41/2/20008:33:2189.21/5/200099.99
51/2/20009:42:0099.09
61/2/200010:00:0090
71/3/20008:00:0043.89
81/3/20008:14:0056.78
91/3/20008:25:0054.54
101/3/200011:00:0077.89
111/5/20008:10:0094
121/5/20009:10:0099.99
131/5/200010:10:00132.76
141/5/200011:10:0080
15
Sheet5


formula in cell F2 is ...

=INDEX(C:C,MIN(IF($A$2:$A$14=E2,IF($B$2:$B$14>=("8:25"+0),ROW($B$2:$B$14)))))

this is then copied down.
 
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Hi Peter. I tried the formula first using your dates and prices which did work but when I changed the prices, so did the values.
Yes, looking at my suggestion on a fresh day indicates that it had no chance of being correct. Sorry for heading you in the wrong direction.

Given that your dates and times are in order, here is another try.

Excel Workbook
ABCDEF
1DateTimePriceReq DateReq Price
202/01/20008:00:2043502/01/200054
302/01/20008:25:005403/01/2000565
403/01/20008:00:00304/01/20006
503/01/20008:27:0556505/01/2000765
603/01/20009:00:08353
704/01/20008:27:056
805/01/20008:25:00765
905/01/20008:27:108
10
Prices(2)
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,680
Members
449,116
Latest member
HypnoFant

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