What syntax would I use if I want a formula to select a value from a separate table?
MY USE CASE:
I have a table to track share purchases in one company (let's use GM as an example). To track accrued gain / loss I inputted a formula that would calculate the current value by selecting a cell (D2) that I have in a header row where I would type in the share price for GM. By using the 'preserve column' and 'preserve row' feature aka syntax $D$2 I could have multiple rows (one for each purchase made at different times) and each distinct purchase would have its own accrued gain / loss. I used to have one table for each company but I have found it better to use one table for multiple companies, so now of course my formula will not work because some rows require the price of GM and other rows require the price of a different company.
MY INQUIRY:
How do I write a formula that will 1) look in that row in column B (where I have the company ticker symbol) to see what company it is (GM or AAPL, etc) and then 2) reference a separate table to look up the price for that company by searching that separate table for the row that contains the ticker symbol? In that separate table I will have column A for ticker symbol and column B for price, so the formula would need to find the ticker symbol in column A and then take the price from column B.
Thanks to all who reply.