Search code examples
arraysgoogle-sheets-formulaarray-formulas

Apply =IMPORTXML to the whole column


To scrape a title for a particular page, I am using this formula, which works fine =IMPORTXML(A1,"//title")

https://docs.google.com/spreadsheets/d/12BugQYZ8ZfUjHkEH96ezsrrbdtSMpxVPv5oGBFBx2Qc/edit?usp=sharing

I would like to apply this formula to the whole column B, so that when adding urls in column A, column B automatically will be filled.


Solution

  • importxml will not work with arrayformula. Instead, try this in cell B1 and drag the formula down:

    =if(A1<>"",IMPORTXML(A1,"//title"),)