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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
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


StockShares8/18/20158/25/201511/4/20152/11/20164/20/2016
BABA200 $ 14,776.00 $ 13,714.00 $ 17,080.00 $ 12,114.00 $ 16,242.00
GLD100 $ 10,711.00 $ 10,916.00 $ 10,597.00 $ 11,906.00 $ 11,897.00

<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>
</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,215,504
Messages
6,125,183
Members
449,212
Latest member
kenmaldonado

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