可以在Google工作表中限制importhtml吗?

时间:2019-11-18 14:54:18

标签: if-statement web-scraping google-sheets google-sheets-formula google-sheets-importxml

我在Google表格上有很多数据。我运行importhtml公式来获取数据。因为我有很多数据,所以出现错误

Error
Loading data may take a while because of the large number of requests. Try to reduce the amount of IMPORTHTML, IMPORTDATA, IMPORTFEED or IMPORTXML functions across spreadsheets that you've created.

因此,我只想仅在首先获得结果,然后在下一个单元格运行import Formula时运行公式。例如:

在此工作表中,所有公式都在同一时间运行,当a1公式获得的值大于单元格A2运行的值时,还有什么方法?

       |      Column A |              
  =====| =================================
   A1  | =query(TRANSPOSE(ImportHtml(H2, "table", 1)), "select * limit 1 offset 1", 0)  
  =====| =================================
   A2  | =query(TRANSPOSE(ImportHtml(H2, "table", 1)), "select * limit 1 offset 1", 0)  
  =====| =================================
   A3  | =query(TRANSPOSE(ImportHtml(H2, "table", 1)), "select * limit 1 offset 1", 0)   

想要这样的东西

       |      Column A |              
  =====| =================================
   A1  | =query(TRANSPOSE(ImportHtml(H2, "table", 1)), "select * limit 1 offset 1", 0)  
  =====| =================================
   A2  | wait for get result for A1  


       |      Column A |              
  =====| =================================
   A1  | Name 1  
  =====| =================================
   A2  | A1 get result now run formula here 

希望这有道理

1 个答案:

答案 0 :(得分:1)

您可以尝试根据所得到的错误,将公式包装到IF语句中,例如:

A1:your formula
A2:=IF(ISERROR(A1),,your formula)
A3:=IF(ISERROR(A2),,your formula)