Reputation: 39
=IFERROR(importxml(B1, "//title/text()"),A1)
I'm using Google Script
to input the above into C1
and fill down.
It works fine when there is only 1 title in each result, but returns an error when there are more than 1 :
Error Array result was not expanded because it would overwrite data in C2
How can I limit the result to just the first title tag found, or (probably better) modify the IFERROR
to handle this array 'error'?
Upvotes: 3
Views: 5522
Reputation: 50799
=IFERROR(importxml(B1, "(//title/text())[1]"),A1)
Or
=ARRAY_CONSTRAIN(IFERROR(importxml(B1, "//title/text()"),A1),1,1)
Mark this as answer, If it solves your problem.
Upvotes: 3