Relentless
New Member
- Joined
- Feb 12, 2016
- Messages
- 1
Hello and thank you in advance for your help! I've referenced this site many times and generally can find the answer to my questions but its just not coming together for me this time!
I'm simply trying to create a dynamic formula for the table-array within a vlookup. I have a large array with years worth of daily stock quotes for dozens of stocks. Unfortunately, the dates do not align for each ticker quote so within the array there are two columns for each stock symbol, one for the date and the other for the quote. Rather than spending the time to align the dates (that get constantly updated), I was attempting to create a vlookup that identified the right ticker and appropriate columns to return the correct stock price.
Here is tiny snapshot of the data set:
[TABLE="width: 620"]
<colgroup><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Column =>[/TD]
[TD]BO[/TD]
[TD]BS[/TD]
[TD]BT[/TD]
[TD]BU[/TD]
[TD]BV[/TD]
[TD]BW[/TD]
[TD]BX[/TD]
[TD]BY[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]BRK B Date[/TD]
[TD]BRK B Price[/TD]
[TD]KMP Date[/TD]
[TD]KMP Price[/TD]
[TD]AHS Date[/TD]
[TD]AHS Price[/TD]
[TD]BHP Date[/TD]
[TD]BHP Price[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/8/11[/TD]
[TD]$84.27[/TD]
[TD]1/20/11[/TD]
[TD]$71.23[/TD]
[TD]2/25/11[/TD]
[TD]$7.53[/TD]
[TD]4/1/11[/TD]
[TD]$81.11[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/9/11[/TD]
[TD]$83.89[/TD]
[TD]1/21/11[/TD]
[TD]$71.88[/TD]
[TD]2/28/11[/TD]
[TD]$7.47[/TD]
[TD]4/4/11[/TD]
[TD]$82.00[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/10/11[/TD]
[TD]$84.45[/TD]
[TD]1/24/11[/TD]
[TD]$72.70[/TD]
[TD]3/1/11[/TD]
[TD]$7.27[/TD]
[TD]4/5/11[/TD]
[TD]$82.41[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/11/11[/TD]
[TD]$84.91[/TD]
[TD]1/25/11[/TD]
[TD]$72.59[/TD]
[TD]3/2/11[/TD]
[TD]$7.16[/TD]
[TD]4/6/11[/TD]
[TD]$83.40[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/14/11[/TD]
[TD]$85.30[/TD]
[TD]1/26/11[/TD]
[TD]$72.87[/TD]
[TD]3/3/11[/TD]
[TD]$7.47[/TD]
[TD]4/7/11[/TD]
[TD]$83.04[/TD]
[/TR]
</tbody>[/TABLE]
Here is the formula that isn't working (in bold where it fails)
=IF(TODAY()<$B81,"",IFERROR(VLOOKUP($B81, ADDRESS(4,MATCH(G4,A3:SS3,0)) & ":" & ADDRESS(5000,MATCH(G4,A3:SS3,0)+1),MATCH(G$4,$BO$3:$SS$3,0),TRUE),""))
I was using the two address functions to create the range for the table-array. By themselves the two address functions return: $BX$4 and $BY$5000 which is the range I want for that particular cell. However, I can't get vlookup to accept the output of the address functions as the range. I've tried playing with index and indirect functions which is where I think this is going but Its either not appropriate or I'm not using the correct syntax.
I could have probably manually re-input every variable in the array with the amount of time I've spent on this but now its personal! lol, I want to make it work!
Thank you for your assistance
I'm simply trying to create a dynamic formula for the table-array within a vlookup. I have a large array with years worth of daily stock quotes for dozens of stocks. Unfortunately, the dates do not align for each ticker quote so within the array there are two columns for each stock symbol, one for the date and the other for the quote. Rather than spending the time to align the dates (that get constantly updated), I was attempting to create a vlookup that identified the right ticker and appropriate columns to return the correct stock price.
Here is tiny snapshot of the data set:
[TABLE="width: 620"]
<colgroup><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Column =>[/TD]
[TD]BO[/TD]
[TD]BS[/TD]
[TD]BT[/TD]
[TD]BU[/TD]
[TD]BV[/TD]
[TD]BW[/TD]
[TD]BX[/TD]
[TD]BY[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]BRK B Date[/TD]
[TD]BRK B Price[/TD]
[TD]KMP Date[/TD]
[TD]KMP Price[/TD]
[TD]AHS Date[/TD]
[TD]AHS Price[/TD]
[TD]BHP Date[/TD]
[TD]BHP Price[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/8/11[/TD]
[TD]$84.27[/TD]
[TD]1/20/11[/TD]
[TD]$71.23[/TD]
[TD]2/25/11[/TD]
[TD]$7.53[/TD]
[TD]4/1/11[/TD]
[TD]$81.11[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/9/11[/TD]
[TD]$83.89[/TD]
[TD]1/21/11[/TD]
[TD]$71.88[/TD]
[TD]2/28/11[/TD]
[TD]$7.47[/TD]
[TD]4/4/11[/TD]
[TD]$82.00[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/10/11[/TD]
[TD]$84.45[/TD]
[TD]1/24/11[/TD]
[TD]$72.70[/TD]
[TD]3/1/11[/TD]
[TD]$7.27[/TD]
[TD]4/5/11[/TD]
[TD]$82.41[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/11/11[/TD]
[TD]$84.91[/TD]
[TD]1/25/11[/TD]
[TD]$72.59[/TD]
[TD]3/2/11[/TD]
[TD]$7.16[/TD]
[TD]4/6/11[/TD]
[TD]$83.40[/TD]
[/TR]
[TR]
[TD][/TD]
[TD]2/14/11[/TD]
[TD]$85.30[/TD]
[TD]1/26/11[/TD]
[TD]$72.87[/TD]
[TD]3/3/11[/TD]
[TD]$7.47[/TD]
[TD]4/7/11[/TD]
[TD]$83.04[/TD]
[/TR]
</tbody>[/TABLE]
Here is the formula that isn't working (in bold where it fails)
=IF(TODAY()<$B81,"",IFERROR(VLOOKUP($B81, ADDRESS(4,MATCH(G4,A3:SS3,0)) & ":" & ADDRESS(5000,MATCH(G4,A3:SS3,0)+1),MATCH(G$4,$BO$3:$SS$3,0),TRUE),""))
I was using the two address functions to create the range for the table-array. By themselves the two address functions return: $BX$4 and $BY$5000 which is the range I want for that particular cell. However, I can't get vlookup to accept the output of the address functions as the range. I've tried playing with index and indirect functions which is where I think this is going but Its either not appropriate or I'm not using the correct syntax.
I could have probably manually re-input every variable in the array with the amount of time I've spent on this but now its personal! lol, I want to make it work!
Thank you for your assistance