google finance 有没有一种方法可以检索最近一个公开市场日的股价数据?

Is there a method for retrieving stock price data for the most recent open market day with google finance?

我正在使用 google 表格,想知道计算日期的最新股票价格。目前我正在使用这个,

=GOOGLEFINANCE("NASDAQ:TSLA", "close",EOMONTH(today(),-1))

如果它 return 的日期不是公开市场日,我会收到错误消息。这是有道理的。不过,我想 return 最近的市场开盘日。不确定这是否可能。提前致谢。

使用:

=VLOOKUP(IF(ABS((LARGE(
 GOOGLEFINANCE("NASDAQ:TSLA", "CLOSE", EOMONTH(TODAY(), -2)+1, EOMONTH(TODAY(), -1)), COUNTIF(
 GOOGLEFINANCE("NASDAQ:TSLA", "CLOSE", EOMONTH(TODAY(), -2)+1, EOMONTH(TODAY(), -1)),">"&
 DATE(YEAR(TODAY()), MONTH(TODAY())-1, DAY(TODAY()))+"16:00")+1))-(
 DATE(YEAR(TODAY()), MONTH(TODAY())-1, DAY(TODAY()))+"16:00"))<ABS((SMALL(
 GOOGLEFINANCE("NASDAQ:TSLA", "CLOSE", EOMONTH(TODAY(), -2)+1, EOMONTH(TODAY(), -1)), COUNTIF(
 GOOGLEFINANCE("NASDAQ:TSLA", "CLOSE", EOMONTH(TODAY(), -2)+1, EOMONTH(TODAY(), -1)),"<"&
 DATE(YEAR(TODAY()), MONTH(TODAY())-1, DAY(TODAY()))+"16:00")+1))-(
 DATE(YEAR(TODAY()), MONTH(TODAY())-1, DAY(TODAY()))+"16:00")), LARGE(
 GOOGLEFINANCE("NASDAQ:TSLA", "CLOSE", EOMONTH(TODAY(), -2)+1, EOMONTH(TODAY(), -1)), COUNTIF(
 GOOGLEFINANCE("NASDAQ:TSLA", "CLOSE", EOMONTH(TODAY(), -2)+1, EOMONTH(TODAY(), -1)),">"&
 DATE(YEAR(TODAY()), MONTH(TODAY())-1, DAY(TODAY()))+"16:00")+1), SMALL(
 GOOGLEFINANCE("NASDAQ:TSLA", "CLOSE", EOMONTH(TODAY(), -2)+1, EOMONTH(TODAY(), -1)), COUNTIF(
 GOOGLEFINANCE("NASDAQ:TSLA", "CLOSE", EOMONTH(TODAY(), -2)+1, EOMONTH(TODAY(), -1)),"<"&
 DATE(YEAR(TODAY()), MONTH(TODAY())-1, DAY(TODAY()))+"16:00")+1)), 
 GOOGLEFINANCE("NASDAQ:TSLA", "CLOSE", EOMONTH(TODAY(), -2)+1, EOMONTH(TODAY(), -1)), 2, 0)
  • 今天明天给你B8
  • 3 号这会给你 B9

尝试

=index(sort(GOOGLEFINANCE("NASDAQ:TSLA", "close",today()-33,3),1,0),2,2)

对于今天的值减去 30 天或之前的值,如果那天是休息日