通过Apps脚本读取汇总Google财务数据结果的单元格的值 [英] Reading the values of cells that summarize Google Finance data results via Apps Script

查看:96
本文介绍了通过Apps脚本读取汇总Google财务数据结果的单元格的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当平均值超过Google财经数据时,Apps Script似乎无法处理使用平均值公式的单元格:

Apps Script seems to be unable to deal with a cell that uses the average formula, when the average is over Google Finance data:

请考虑A列中包含来自Google财经的数据.然后,您键入单元格B1 =average(A1:A100).假设平均值为5,并且这样的单元格中,B1显示5.很好,除了使用以下脚本会失败:

Consider that column A is full of data from Google Finance. Then you type into cell B1 =average(A1:A100). Lets assume the average is 5 and as such cell, B1 shows 5. Great, except that using the following script will fail:

var AveResult = spreadsheet.getRange('B1').getValue();
---->日志显示为#DIV/0!错误

var AveResult = spreadsheet.getRange('B1').getValue();
----> The log show a #DIV/0! error

另一方面,如果您覆盖B1中的公式并只需键入5,则它可以正常工作:

On the other hand, if you overwrite the formula in B1 and simply type in a 5, then it works perfectly:

var AveResult = spreadsheet.getRange('B1').getValue();
---->日志显示5

var AveResult = spreadsheet.getRange('B1').getValue();
----> The log shows 5

有没有办法解决此问题,将脚本与Google Finance数据摘要一起使用?

Is there any way to get around this problem, to use scripts with summaries of Google Finance data?

谢谢.

推荐答案

官方所写文档

无法通过Sheets API或 Apps脚本下载或访问历史数据.如果尝试这样做,则会看到#N/A错误,而不是相应单元格中的值.电子表格.

Historical data cannot be downloaded or accessed via the Sheets API or Apps Script. If you attempt to do so, you will see a #N/A error in place of the values in the corresponding cells of your spreadsheet.

平均公式是不是问题.似乎不可能通过任何公式来获取历史财务数据.

The average formula is NOT the problem. Any attempt to take historical finance data through any formula hoops doesn't seem to be possible.

这篇关于通过Apps脚本读取汇总Google财务数据结果的单元格的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆