使用GoogleFinance,您能否获得以上日期的股票的上面交易日的收盘价?

发布于 2025-02-13 06:12:32 字数 384 浏览 2 评论 0原文

我想使用一个公式输入日期并获得上一个交易日的收盘价。

我一直无法在线找到解决方案。查看时,我找到了“最近的”属性,但这似乎不允许您输入日期。

我尝试从日期开始减去1,以获取前一天。但是,当前一天是关闭市场的时候(例如周末)时,我获得的收盘价与输入的日期相同。

例如,6月24日(星期五)Google的收盘价为2370.76,6月27日(星期一)为2332.45。我想要一个公式,该公式将在6月27日给定日期的6月24日的收盘价。我尝试了以下公式:

=INDEX(GOOGLEFINANCE("GOOG","close","27/06/22"-1),2,2)

但是这给出了6月27日的收盘价(2332.45)。 (注意日期将是对另一个单元格的引用。)

I want to use a formula to input a date and get the previous trading day's closing price.

I have been unable to find a solution online. When looking, I found the "closeyest" attribute, but it seems this doesn't allow you to enter a date.

I have tried subtracting 1 from the date to get the previous day. However, when the previous day is when markets are closed (such as a weekend), the closing price I get is the same as the date inputted.

For example, the closing price of Google on June 24 (Friday) was 2370.76 and June 27 (Monday) was 2332.45. I want a formula which would give the closing price of June 24 when given the date of June 27. I have tried the following formula:

=INDEX(GOOGLEFINANCE("GOOG","close","27/06/22"-1),2,2)

But this gives the closing price of June 27 (2332.45). (Note the date would be a reference to another cell.)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

优雅的叶子 2025-02-20 06:12:32
  • 获取前7天的一系列数据,
  • 使用end_date参数限制最终日期,
  • 使用dirty查找,search_key
=LOOKUP(9^99,GOOGLEFINANCE("GOOG","close","27/6/22"-8, "27/6/22"))
  • Get a range of data for the previous 7 days
  • Use the end_date parameter to limit the final date
  • Use dirty lookup with a high number as search_key as the data is sorted
=LOOKUP(9^99,GOOGLEFINANCE("GOOG","close","27/6/22"-8, "27/6/22"))
李不 2025-02-20 06:12:32

尝试:

=INDEX(SORT(GOOGLEFINANCE("GOOG","close","27/06/22"-8, "27/06/22"-1), 2, 0), 2, 2)

try:

=INDEX(SORT(GOOGLEFINANCE("GOOG","close","27/06/22"-8, "27/06/22"-1), 2, 0), 2, 2)

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文