4

How to get Taiwan Stock Exchange Index in google spreadsheet? This index do exist in google finance under https://www.google.com/finance?q=TPE%3ATAIEX

I tried the following formula, but all of them are failed.

=GoogleFinance("TPE:TAIEX"; "price")
=GoogleFinance("TPE.TAIEX"; "price")
=GoogleFinance("TAIEX.TW"; "price")
=GoogleFinance("TAIEX:TPE"; "price")
=GoogleFinance("TAIEX.TPE"; "price")
=GoogleFinance("TPE%3ATAIEX"; "price")
Wen Hsiao
  • 631
  • 1
  • 7
  • 16
  • [From the docs](https://support.google.com/drive/answer/3093281): "GOOGLEFINANCE is only available in English and does not support most international exchanges". I'd guess that's the problem. – stoneage Feb 14 '14 at 02:43

2 Answers2

2
=GoogleFinance("TWII"; "price")
Undo
  • 25,519
  • 37
  • 106
  • 129
xpawn
  • 36
  • 2
1

I can propose you 2 work around:

The appscript trick:
build a google apps script to retrieve the data from your favorite site. Bellow an exemple with the site http://www.bloomberg.com/quote/TWSE:IND. I don't know if this exemplpe feet your need so you can change the script quite easily changing the regexp and the site url.
Please note as I'm french I need to change "," for "." that may not be necessary for you.

function twn(){
var feed = UrlFetchApp.fetch("http://www.bloomberg.com/quote/TWSE:IND");  // URL of your favorite site
  var taux = feed.getContentText().match(/meta itemprop\="price" content\="[0-9,\.]*"/); // looking for a regexp in the retrieved page
  taux = taux[0].slice(31,taux[0].length-1); // cleaning around what you retrieved
  taux = taux.replace(",",""); // french trick
  taux = taux.replace(".",","); // french trick
  Logger.log("taux: "+taux); // a little log to check Is I'm not doing anything bad
  return(taux); // result displayed in your spreadsheet when you call function twn()
}

The spreadsheet trick:

in your spreadsheet use the formula:
=mid(REGEXEXTRACT(concatenate(Importdata("http://www.bloomberg.com/quote/TWSE:IND"));"itemprop=""price"" content=""[0-9,\.]*");27;10)

Harold
  • 3,297
  • 1
  • 18
  • 26