从 GetQuote 扩展返回的数组中选择单个列
Ted Schlossmacher 的免费 OpenOffice.org Calc 的 GetQuote 扩展 允许用户访问所跟踪的多种符号类型的报价由雅虎!金融。具体来说,GETHISTORY()
函数返回一系列过去和现在的报价。
安装扩展程序后,尝试突出显示 5 列范围,然后键入 =GETHISTORY("PETR4.SA",1,TODAY()-1)
(您可能需要使用分号而不是逗号)然后按Ctrl+Shift+Return
。这应该为您提供巴西石油巨头 Petrobras SA 的优先股 PETR4 的日期、开盘价、最高价、最低价和收盘价
我的问题是:我如何在一个单元格中插入一个公式,该公式将返回我的价值上述数组的第 5 列?
Ted Schlossmacher's free GetQuote extension for OpenOffice.org Calc allows users to access quotes for several types of symbols tracked by Yahoo! Finance. Specifically, the GETHISTORY()
function returns a range of past and present quotes.
After installing the extension, try highlighting a 5-column range and then typing =GETHISTORY("PETR4.SA",1,TODAY()-1)
(you might need to use semicolons instead of commas) and then pressing Ctrl+Shift+Return
. That should provide you with date, open, high, low and close quotes for PETR4, the preferred stock of Brazilian oil giant Petrobras S.A.
My question is: how can I, in one cell, insert a formula that would return me the value of the 5th column of the above array?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这可以通过 INDEX 函数来完成。您不需要使用 ctrl+shift+enter 来使其工作,因为它不返回数组。
2 个结束参数是
row
、column
,并且是数组中从 1 开始的索引。有关
INDEX
的更多信息可以在任何 Excel 网站上找到,或者在 LibreOffice Calc 帮助中找到,网址为 https://help.libreoffice.org/Calc/Spreadsheet_Functions#INDEXThis can be done with the
INDEX
function. You don't need to use ctrl+shift+enter for it to work as it does't return an array.The 2 end parameters are
row
,column
, and are a 1-based index into the array.More information about
INDEX
can be found on any Excel website, or in the LibreOffice Calc help at https://help.libreoffice.org/Calc/Spreadsheet_Functions#INDEX可以使用第二个参数检索昨天的收盘价,例如:
=GETQUOTE("TD.TO",21)
从手册中:
GETQUOTE 可以获取 31 种类型的报价。类型编号为 0 到 30。该函数接受这些数字作为第二个参数。
Yesterday's closing price can be retrieved using a second argument, for example:
=GETQUOTE("TD.TO",21)
From the manual:
GETQUOTE can fetch 31 types of quotes. The types are numbered from 0 to 30. The function accepts these numbers as the second argument.
如果您只需要最新价格(这是第五个字段),我相信您可以简单地使用:
我不确定这是否可以在市场开盘时返回当前价格,但它确实会在市场收盘时返回最后的交易价格。
If you need only the latest price (which is the fifth field) I believe you can simply use:
I'm not certain this works to return the current price when markets are open, but it does return the last trade price when markets are closed.