uberathlete
Board Regular
- Joined
- Jul 11, 2007
- Messages
- 117
Hi everyone, I need some help badly. Basically, here's the situation:
I'm trying to fill column H and column I. In column H should be the price of the symbol specified in column G on the last hour of the date specified in column F. So it's like the end of day price of that date.
Column I on the other hand should have the price of the symbol specified in column G on the last hour of the previous (or last) date before the date specified in column F that has that symbol's price.
So in this case, for a Today date of 1/4/00, Today's Price should be the price of BAXH0 on 1/4/00 at the last hour which is 8:01:06 AM. So cell H2 will have 94.51. Cell I2 on the other hand won't have any price because there is no date before 1/4/00.
For a Today date of 1/7/00, Today's Price should be the price of BAXM0 on 1/7/00 at 8:03:24 AM. So cell H4 will have a price of 94.09. In cell I4, the price should be from the previous date containing that symbol at the last hour which is on 1/5/00 at 8:01:48 AM. So the price in cell I4 is 94.09.
The result should thus be:
Anyone know how I could do this? I hope my description isn't too confusing, but any suggestions would be much appreciated.
Excel Workbook | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | Date | Symbol | Time | Price | Today | Symbol | Today's Price | PreviousDay's Price | |||
2 | 1/4/00 | BAXM0 | 8:00:30 AM | 94.09 | 1/4/00 | BAXH0 | |||||
3 | 1/4/00 | BAXH0 | 8:01:00 AM | 94.51 | 1/5/00 | BAXH0 | |||||
4 | 1/4/00 | BAXH0 | 8:01:00 AM | 94.51 | 1/7/00 | BAXM0 | |||||
5 | 1/4/00 | BAXH0 | 8:01:06 AM | 94.51 | |||||||
6 | 1/5/00 | BAXM0 | 8:01:12 AM | 94.09 | |||||||
7 | 1/5/00 | BAXM0 | 8:01:42 AM | 94.09 | |||||||
8 | 1/5/00 | BAXM0 | 8:01:48 AM | 94.09 | |||||||
9 | 1/5/00 | BAXH0 | 8:02:00 AM | 94.51 | |||||||
10 | 1/5/00 | BAXH0 | 8:02:06 AM | 94.51 | |||||||
11 | 1/7/00 | BAXH0 | 8:02:24 AM | 94.09 | |||||||
12 | 1/7/00 | BAXH0 | 8:02:54 AM | 94.09 | |||||||
13 | 1/7/00 | BAXM0 | 8:03:24 AM | 94.09 | |||||||
Sheet1 |
I'm trying to fill column H and column I. In column H should be the price of the symbol specified in column G on the last hour of the date specified in column F. So it's like the end of day price of that date.
Column I on the other hand should have the price of the symbol specified in column G on the last hour of the previous (or last) date before the date specified in column F that has that symbol's price.
So in this case, for a Today date of 1/4/00, Today's Price should be the price of BAXH0 on 1/4/00 at the last hour which is 8:01:06 AM. So cell H2 will have 94.51. Cell I2 on the other hand won't have any price because there is no date before 1/4/00.
For a Today date of 1/7/00, Today's Price should be the price of BAXM0 on 1/7/00 at 8:03:24 AM. So cell H4 will have a price of 94.09. In cell I4, the price should be from the previous date containing that symbol at the last hour which is on 1/5/00 at 8:01:48 AM. So the price in cell I4 is 94.09.
The result should thus be:
Excel Workbook | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | |||
1 | Date | Symbol | Time | Price | Today | Symbol | Today's Price | PreviousDay's Price | |||
2 | 1/4/00 | BAXM0 | 8:00:30 AM | 94.09 | 1/4/00 | BAXH0 | 94.51 | ||||
3 | 1/4/00 | BAXH0 | 8:01:00 AM | 94.51 | 1/5/00 | BAXH0 | 94.99 | 94.51 | |||
4 | 1/4/00 | BAXH0 | 8:01:00 AM | 94.51 | 1/7/00 | BAXM0 | 94.09 | 92.25 | |||
5 | 1/4/00 | BAXH0 | 8:01:06 AM | 94.51 | |||||||
6 | 1/5/00 | BAXM0 | 8:01:12 AM | 94.09 | |||||||
7 | 1/5/00 | BAXM0 | 8:01:42 AM | 94.09 | |||||||
8 | 1/5/00 | BAXM0 | 8:01:48 AM | 92.25 | |||||||
9 | 1/5/00 | BAXH0 | 8:02:00 AM | 94.58 | |||||||
10 | 1/5/00 | BAXH0 | 8:02:06 AM | 94.99 | |||||||
11 | 1/7/00 | BAXH0 | 8:02:24 AM | 94.09 | |||||||
12 | 1/7/00 | BAXH0 | 8:02:54 AM | 94.09 | |||||||
13 | 1/7/00 | BAXM0 | 8:03:24 AM | 94.09 | |||||||
Sheet1 |
Anyone know how I could do this? I hope my description isn't too confusing, but any suggestions would be much appreciated.