Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
85 views
in Technique[技术] by (71.8m points)

javascript - How to call a custom function with multiple arguments in google spreadsheet


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I don't see anything wrong with your usage and function, it should work.

I confirmed it by copying your function and testing it.

testing

function showing next to debug

How to correct an #ERROR! error?

Carefully check your formula for accuracy.

Most #ERROR errors are caused by typos on the call of the function or on your actual function itself so you might have to check that.

You can try refreshing the sheet. It sometimes needs a refresh when your function was recently modified.

If it still doesn't work, kindly show the error the cell is showing with the formula. Just hover your pointer over the #ERROR cell and take a screen shot which should be like this:

error

  • By doing this, it will tell us what caused the error. (In this case, I modified the function to induce an #ERROR, changing val to val2)

EDIT:

  • As per TheMaster mentioned in the comment, it is caused by the delimiter ,. And you just confirmed you are from Europe on a comment below, thus this actually applies to you.

Locations using decimal commas:

For locations using commas to denote decimal separators (most European countries), the syntax will follow this structure:

Decimals will be denoted by a comma Arguments in formulas separated by a semi-colon

Thus your function reads 77,5 as Test(77.5, ) which results into #NUM!

Use ; instead.

=Test(77;5)

Reference:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...