JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
983 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Testing a simple "Split" function in an Excel on Microsoft 365 Apps:
/**
* @customfunction
*/
async function split(text, separator) {
return [text.split(separator)];
}
But the function keeps returning a #VALUE error.
The function:
/**
* @customfunction
*/
async function test(text) {
return text;
}
Returns correctly, the function:
/**
* @customfunction
*/
async function test(text) {
return [text,text][text,text];
}
Returns zero.
What am I doing wrong here?
Hi @Luiz Hemerly ,
You can try this,
/**
* @customfunction
* @returns {string[][]} A dynamic array with multiple results.
*/
async function split(text, separator) {
return [text.split(separator)];
}
Here is a doc for your reference.
Thanks!