Lookup value from closed workbook based on 2 criteria function

cornfedtm

New Member
Joined
Aug 16, 2018
Messages
2
I'm, in a way, attempting to replicate the popular StockQuotes function that is useless now that Yahoo took down the ichart site. I have saved excel files with historical price data named by the stock symbol (ex: BABA.xls, MSFT.xls). Based on Symbol and Date, I've been trying to use VLOOKUP with the Table Array field housing the file path and filename and search location. I have to change the file name manually for each symbol however. Is there a way to have the formula update the file name automatically when it is changed? I'm not familiar enough with VBA to attempt a function, although ideas would be much appreciated.
The price data files have 5 columns (Date, Open, High, Low, Close). Using Date row and Close column to lookup the closing price. The price data files are closed during the lookup.
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
Below are a couple of examples of the current formula and table layout I'm using:

=VLOOKUP(C$2,'E:\Dropbox\Pub\CSI Stock File Downloads\[BABA.XLS]Sheet1'!$A$1:$E$65536,5,FALSE)*$B3
=VLOOKUP(C$2,'E:\Dropbox\Pub\CSI Stock File Downloads\[GLD.XLS]Sheet1'!$A$1:$E$65536,5,FALSE)*$B4



<colgroup><col style="width:48pt" width="64"> <col style="mso-width-source:userset;mso-width-alt:3437;width:71pt" width="94"> <col style="mso-width-source:userset;mso-width-alt:4169;width:86pt" width="114"> <col style="mso-width-source:userset;mso-width-alt:3657; width:75pt" width="100" span="3"> <col style="mso-width-source:userset;mso-width-alt:3218;width:66pt" width="88"> </colgroup><tbody>
[TD="class: xl110, width: 64"]Stock[/TD]
[TD="class: xl110, width: 94"]Shares[/TD]
[TD="class: xl113, width: 114, align: right"]8/18/2015[/TD]
[TD="class: xl113, width: 100, align: right"]8/25/2015[/TD]
[TD="class: xl113, width: 100, align: right"]11/4/2015[/TD]
[TD="class: xl113, width: 100, align: right"]2/11/2016[/TD]
[TD="class: xl113, width: 88, align: right"]4/20/2016[/TD]

[TD="class: xl109"]BABA[/TD]
[TD="class: xl111, align: right"]200[/TD]
[TD="class: xl112"] $ 14,776.00 [/TD]
[TD="class: xl112"] $ 13,714.00 [/TD]
[TD="class: xl112"] $ 17,080.00 [/TD]
[TD="class: xl112"] $ 12,114.00 [/TD]
[TD="class: xl112"] $ 16,242.00 [/TD]

[TD="class: xl109"]GLD[/TD]
[TD="class: xl111, align: right"]100[/TD]
[TD="class: xl112"] $ 10,711.00 [/TD]
[TD="class: xl112"] $ 10,916.00 [/TD]
[TD="class: xl112"] $ 10,597.00 [/TD]
[TD="class: xl112"] $ 11,906.00 [/TD]
[TD="class: xl112"] $ 11,897.00 [/TD]

</tbody>

When symbols are changed in column A, is there a way for the file name in the formula to update automatically, rather than manually. Takes a lot of time the longer the list gets. Thanks.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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