织梦CMS - 轻松建站从此开始!

欧博ABG-会员注册-官网网址

欧博官网Is there a way to call GOOGLEFINANCE that work

时间:2025-08-24 10:52来源: 作者:admin 点击: 14 次
In google sheets, if I want today's share price of AAPL, I can use: =GOOGLEFINANCE("AAPL") Per: Support > GOOGLEFINANCE That is not &q

In google sheets, if I want today's share price of AAPL, I can use:

=GOOGLEFINANCE("AAPL")

Per: Support > GOOGLEFINANCE

That is not "today's share price" but the most recent price delayed by to 20 minutes.

If any date parameters are specified, the request is considered historical and only the historical attributes are allowed.
 

You could try combining two GOOGLEFINANCE formulas but you'd need to address the different types of results:

=QUERY( { GOOGLEFINANCE("NASDAQ:AAPL", "price", "11/18/2024", 3); NOW(), GOOGLEFINANCE("AAPL") }, "Order by Col1 Desc", 1)

Formula

Example adapting combined formula

Shows how the formulas above can be used dynamically based on whether the end date is today.

Returns historical close prices based on an end date and a maximum number of days (markets may not be open for all historical dates).

Includes the current price if the end date is today.

Sample values used:

End date in A2

Max history in B2

=LET( dt,A2, td,dt=TODAY(), daze,B2-td, hist,REDUCE(1/0,SEQUENCE(3,1,,-1), LAMBDA(a,v, IF(ISERROR(a), GOOGLEFINANCE("NASDAQ:AAPL", "price", dt-daze, daze), a))), QUERY(IF(td,IFNA(VSTACK(hist,{dt,GOOGLEFINANCE("AAPL")})),hist), "Order by Col1 Desc", 1))

Example using Today's date

Using Today's Date

Example using yesterday's date

Using Yesterday's Date

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-09-01 02:09 最后登录:2025-09-01 02:09
栏目列表
推荐内容