如何在单独的栏中基于日期获取某物的价格?

时间:2019-06-24 07:47:28

标签: google-sheets google-sheets-formula array-formulas google-finance gs-vlookup

我想获取某个日期的BTC价格。 A列是这样:

=GoogleFinance("CURRENCY:USDBTC","close","date")

具有日期列表的B列:

  • B1-11/02/2018 00:00:00
  • B2-12/02/2018 00:00:00

如何使它正常工作?

=GoogleFinance("CURRENCY:USDBTC","close","B1")

没用

2 个答案:

答案 0 :(得分:0)

=INDEX(GoogleFinance("CURRENCY:BTCUSD","close",B2),2,2)

答案 1 :(得分:0)

=ARRAYFORMULA(IFERROR(VLOOKUP(TEXT(B1:B, "dd/mm/yyyy"), 
 {TEXT(GOOGLEFINANCE("CURRENCY:USDBTC", "close", MIN(B1:B), MAX(B1:B)+1), "dd/mm/yyyy"), 
       GOOGLEFINANCE("CURRENCY:USDBTC", "close", MIN(B1:B), MAX(B1:B)+1)}, 4, 0)))

0