如何评估自定义函数中的电子表格公式? [英] How to evaluate a spreadsheet formula within a custom function?

查看:112
本文介绍了如何评估自定义函数中的电子表格公式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在电子表格中,我可以在单元格中输入 = SIN(45)+123 ,并将对其进行评估。



如何评估自定义函数中的电子表格函数,例如像这样工作的eval
函数:
$ b

  function myFunc(){
return Sheet.eval(= SIN(45)+123)
}

有可能吗?



请注意,我并不关心 SIN 函数,特别是我想要访问完整的电子表格函数库( PMT QUERY NPER

解决方案

来自Apps-Script的电子表格函数



不可能 - 这已被问了很多次。建议您检查google-apps-script问题列表以查看是否有任何更改。但是最后我检查了一下,没有办法去做,他们也没有计划添加它。 https://code.google.com/p/google-apps -script-issues / issues / list

Ethercalc - java脚本电子表格公式



如果你需要的话,您可以随时复制ethercalc中的代码,因为它具有电子表格公式的Java脚本版本。
https://github.com/audreyt/ethercalc


In a spreadsheet I can enter =SIN(45)+123 in a cell, and it will be evaluated.

How can I evaluate spreadsheet functions within a custom function, something like an "eval" function that would work like this :

function myFunc() {
  return Sheet.eval("=SIN(45)+123")
}

is it possible ?

Note that I don't care about the SIN function in particular, what I want is to have access to the complete arsenal of spreadsheet functions (PMT, QUERY, NPER, etc..)

解决方案

Spreadsheet functions from Apps-Script

Not possible - This has been asked many times. Suggest you check the google-apps-script issue list to see if anything has changed. But last I checked, there is no way to do it, and they have no plan to add it. https://code.google.com/p/google-apps-script-issues/issues/list

Ethercalc - java script spreadsheet formulas

If you need to, you can always copy the code from "ethercalc" as it has a java script versions of the spreadsheet formulas. https://github.com/audreyt/ethercalc

这篇关于如何评估自定义函数中的电子表格公式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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