简体   繁体   中英

Using ArrayFormula for "myfunction" custom formula - Google Sheets

Could you help me with this?

I have one "myfunction" formula which is simple script:

`

function myFunction(url)
{
   url = "https://www.google.com/search?q=site:"+url;
      var options = {
     'muteHttpExceptions': true,
     'followRedirects': true
   };
   var response = UrlFetchApp.fetch(url, options);
   var html     = response.getContentText();
   if (html.match(/Your search -.*- did not match any documents./) ){
     return "Not Indexed";
     }
     else {
     return "Indexed";
     }
}

`

And what I want to do is to use ArrayFormula for this funciton but it is not working.

Here's the spreadsheet with example: https://docs.google.com/spreadsheets/d/1CYuRd8SlkRVoQjWrFcOzMB387bJU15zLhunylPRIEJY/edit?usp=sharing

Any ideas?

Thanks a lot!

I've tried this one:

=arrayformula(myfunction(A3))

use:

=BYROW(A1:INDEX(A:A, COUNTA(A:A)), LAMBDA(x, myfunction(x)))

在此处输入图像描述


update:

=INDEX(IF((A1:A="")+ISDATE_STRICT(A1:A)+ISNUMBER(A1:A),,
 BYROW(A1:INDEX(A:A, COUNTA(A:A)), LAMBDA(x, myfunction(x)))))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM