Is there a way to determine if a value is included in an array? #1148
ElixirMike
started this conversation in
API Questions
Replies: 2 comments
-
Hi @ElixirMike, thanks for reaching out to us. The third parameter of the const result = hf.calculateFormula('=MATCH("one", {"one","two"}, 0)', 0);
console.log(result); |
Beta Was this translation helpful? Give feedback.
0 replies
-
ah, on your documentation, it just listed "Type", so I thought that meant data type. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm just learning the basics of hyperformula and trying to see if it will work with some of our requirements.
In our case, we will need the ability to work with arrays of data . We are thinking about using just passing in what data we need evaluated and run a one-off calculation.
Consider that we have an array of data with {"one","two"}.
I now want to run a condition to check if "one" exists in the array.
I 'm trying to use the MATCH function as I can't find anothe r function that would be like an INCLUDES or CONTAINS.
const result=hfInstance.calculateFormula(
=MATCH("one",{"one","two"},"Text")
,0)This throws error
DetailedCellError {
value: '#VALUE!',
address: undefined,
type: 'VALUE',
message: 'Value cannot be coerced to number.'
}
Is there a way to check if a value is in an array? Are there functions that would let me retrieve a specific value in the array?
Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions