I don't see anything wrong with your usage and function, it should work.
I confirmed it by copying your function and testing it.
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:
- 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:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…