Google-sheets – How to link cell within googlefinance formula

formulasgoogle sheetsgoogle-finance

I'm trying to get the googlefinance formula to work for multiple country exchanges.

e.g. Tencent is listed on Hong Kong stock exchange, the code is 0700.

If I put =googlefinance(HKG:0700,"price"), it works, but I want to link the 0700 part to another cell, so it will look like =googlefinance(HKG:A2,"price").

But I can't type A2 physically, because it will not be treated as taking the content of cell A2.

Best Answer

Use string concatenation with &:

=googlefinance("HKG:"&A2,"price")

enter image description here

Note that I had to put '0700 in A2, or change the cell format to 'plain text'; just typing in 0700 will result in Google Sheets converting it automatically to 700.