仅将 IMAGE 函数添加到通过 IMPORTXML 收集的一列数据
add IMAGE function to only one column of data collected via IMPORTXML
我从单个IMPORTXML
导入数据,分成两列如下:
=ArrayFormula(IFERROR(HLOOKUP(1,{1;IMPORTXML(A1,"
//table[@class='table squad sortable']//td[@class='photo']/a/img/@src |
//table[@class='table squad sortable']//td[@class='name large-link']/a/@href")},
(ROW(A:A)+1)*2-TRANSPOSE(sort(ROW($A:$A)+0,1,0)))))
我想知道是否有任何方法可以不必多次调用 importxml 并仅在第一列中添加 IMAGE
函数,所以我不必把它像我现在一样分开。
link 到电子表格:
https://docs.google.com/spreadsheets/d/10_G3QjcLcE9dYz_0m8PjPxHDAAaKL7BGEehTfmprYTQ/edit?usp=sharing
你可以用一个公式做的最好的事情是:
=ARRAYFORMULA({IFERROR(IMAGE(IMPORTXML(A1,
"//table[@class='table squad sortable']//td[@class='photo']/a/img/@src"))),
QUERY(IFERROR(HLOOKUP(1, {1; IMPORTXML(A1,
"//table[@class='table squad sortable']//td[@class='photo']/a/img/@src | //table[@class='table squad sortable']//td[@class='name large-link']/a/@href")},
(ROW(A:A)+1)*2-TRANSPOSE(SORT(ROW($A:$A)+0, 1, 0)))), "where Col1 !=''", 0)})
我从单个IMPORTXML
导入数据,分成两列如下:
=ArrayFormula(IFERROR(HLOOKUP(1,{1;IMPORTXML(A1,"
//table[@class='table squad sortable']//td[@class='photo']/a/img/@src |
//table[@class='table squad sortable']//td[@class='name large-link']/a/@href")},
(ROW(A:A)+1)*2-TRANSPOSE(sort(ROW($A:$A)+0,1,0)))))
我想知道是否有任何方法可以不必多次调用 importxml 并仅在第一列中添加 IMAGE
函数,所以我不必把它像我现在一样分开。
link 到电子表格: https://docs.google.com/spreadsheets/d/10_G3QjcLcE9dYz_0m8PjPxHDAAaKL7BGEehTfmprYTQ/edit?usp=sharing
你可以用一个公式做的最好的事情是:
=ARRAYFORMULA({IFERROR(IMAGE(IMPORTXML(A1,
"//table[@class='table squad sortable']//td[@class='photo']/a/img/@src"))),
QUERY(IFERROR(HLOOKUP(1, {1; IMPORTXML(A1,
"//table[@class='table squad sortable']//td[@class='photo']/a/img/@src | //table[@class='table squad sortable']//td[@class='name large-link']/a/@href")},
(ROW(A:A)+1)*2-TRANSPOSE(SORT(ROW($A:$A)+0, 1, 0)))), "where Col1 !=''", 0)})