在Google电子表格中,如何查询"GoogleFinance"过去的汇率?

ant*_*ntr 47 google-docs google-sheets currency-exchange-rates

我想知道是否可以在Google电子表格中查询过去的汇率.

例如; 使用公式=GoogleFinance("CURRENCY:USDEUR")将在此时返回美元/欧元汇率.你如何找回历史汇率?

Mik*_* B. 90

要检索历史汇率,您必须使用以下公式:

=GoogleFinance("eurusd","price",today()-1,today())
Run Code Online (Sandbox Code Playgroud)

其中today() - 1,today()是所需的时间间隔,可以明确定义为静态日期对,或隐式地,作为动态计算的值,如上例所示.此表达式将返回日期和关闭值的两列数组.关注合适的单元格格式(日期/数字)非常重要,否则您的数据将被破坏.

如果您想获得没有列标题的日期和货币汇率的纯行,请使用INDEX()函数包装您的公式:

=INDEX(GoogleFinance("eurusd","price",today()-1,today()),2,)
Run Code Online (Sandbox Code Playgroud)

要仅检索汇率值,请定义列号参数:

=INDEX(GoogleFinance("eurusd","price",today()-1,today()),2,2)
Run Code Online (Sandbox Code Playgroud)

为了获得在今天的货币汇率谷歌文档/电子表格谷歌财经:

=GoogleFinance("eurusd","price",today())
Run Code Online (Sandbox Code Playgroud)

PS前段时间有一个问题,即获得今天的费率的简短方法,但现在它有效,你可以再次使用:

=GoogleFinance("currency:usdeur")
Run Code Online (Sandbox Code Playgroud)

PS如何获得Microsoft Excel中的实时货币汇率:

  • 您还可以使用DATE列并使用它代替today() - 1,today()来获取当天的历史数据. (7认同)

Vas*_*sim 17

尝试,

=GoogleFinance("usdeur","price",date(2013,12,1),date(2013,12,16))
Run Code Online (Sandbox Code Playgroud)

确保日期符合您的电子表格设置.

编辑为评论,更改日期以捕获单日数据: -

仅限标题:

=INDEX(GoogleFinance("usdeur","price",date(2013,12,3),date(2013,12,4)),,2)
Run Code Online (Sandbox Code Playgroud)

没有标题:

=FILTER(INDEX(GoogleFinance("usdeur","price",date(2013,12,3),date(2013,12,4)),,2),INDEX(GoogleFinance("usdeur","price",date(2013,12,3),date(2013,12,4)),,2)<>"Close")
Run Code Online (Sandbox Code Playgroud)


Dav*_*ann 10

所有与googlefinance相关的说明都在此处:https://support.google.com/docs/answer/3093281

请记住,实际的Google Spreadsheets公式使用分号(;)而不是逗号(,).一旦做出替换,一些例子将如下所示:

对于30天的美元兑欧元指数,您应该使用(请注意,对于货币,它们在同一个第一个变量中一起使用):

=INDEX(GoogleFinance(USDEUR;"price";today()-30;today());2;2)
Run Code Online (Sandbox Code Playgroud)

提示:你可以得到通过简单地改变INDEX为SPARKLINE,这样在电池的整个尺寸:

=SPARKLINE(GoogleFinance(USDEUR;"price";today()-30;today());2;2)
Run Code Online (Sandbox Code Playgroud)