1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Google Spreadsheet で日本株の会社名と株価を取得する

Last updated at Posted at 2025-09-15

日本株の株価を取得する関数の追加

  1. Google Spreadsheet で、データ → 名前付き関数 を選択
  2. 新しい関数を追加 をクリック
  3. 関数名に GET_STOCK_PRICE_JP を入力 (名前はなんでも良い)
  4. 引数のプレースホルダーに ticker と入力して、リターン
  5. 数式の定義に、以下を張り付ける
    =VALUE(SUBSTITUTE(IMPORTXML("https://www.google.com/finance/quote/" & ticker & "?hl=ja","//*[@class=""YMlKec fxKbKc""]"), "¥", ""))
    
  6. 次へ作成をクリックして保存
  7. スプレッドシート上で、=GET_STOCK_PRICE("8058:TYO") 等として株価を取得。8058:TYO は Google Finance のティッカー

日本株の会社名を取得する関数の追加

関数名を GET_STOCK_NAME 等、数式の定義を、

=IMPORTXML("https://www.google.com/finance/quote/" & ticker & "?hl=ja","//*[@class=""zzDege""]")

として、日本株の株価を取得する関数の追加と同じ手順を実行。
=GET_STOCK_NAME("8058:TYO") 等で会社名が取得できる。

おまけ

  • USDJPY
    GET_STOCK_PRICE("USD-JPY")
    
  • オルカン
    =VALUE(IMPORTXML("https://finance.yahoo.co.jp/quote/0331418A","(//*[@class=""StyledNumber__value__3rXW""])[1]"))
    
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?