本文介绍了当我在表格中使用查询导入范围时如何显示个性化消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有importrange的查询功能,但是当查询在数据库中找不到任何内容时,我需要一条个性化消息.目前,我正在使用此公式.

I'm using a query function with importrange but I need a personalized message when query couldn't find anything in the database. Currently I'm using this formula.

=QUERY(
  {
    IMPORTRANGE("url", "'Parte 1'!A1:AH");
    IMPORTRANGE("url", "'Parte 2'!A1:AH");
    IMPORTRANGE("url", "'Parte 3'!A1:AH");
    IMPORTRANGE("url", "'Parte 4'!A1:AH")
  }, "Select Col2, Col1, Col34, Col24, Col3, Col4, Col5, Col6, Col11, Col7, Col8,
             Col9, Col10, Col12, Col13, Col14, Col15, Col20, Col21, Col22, Col23
      Where Col10="&$C$1&" And Col22 != 'Duplicado'")

推荐答案

尝试:

=ARRAYFORMULA(QUERY({
 IFERROR(IMPORTRANGE("url", "'Parte 1'!A1:AH"),
         {"1 not working", SUBSTITUTE(COLUMN(B:AH)^0, 1, )});
 IFERROR(IMPORTRANGE("url", "'Parte 2'!A1:AH"),
         {"2 not working", SUBSTITUTE(COLUMN(B:AH)^0, 1, )});
 IFERROR(IMPORTRANGE("url", "'Parte 3'!A1:AH"),
         {"3 not working", SUBSTITUTE(COLUMN(B:AH)^0, 1, )});
 IFERROR(IMPORTRANGE("url", "'Parte 4'!A1:AH"),
         {"4 not working", SUBSTITUTE(COLUMN(B:AH)^0, 1, )})},
 "select Col2,Col1,Col34,Col24,Col3,Col4,Col5,Col6,Col11,Col7,Col8,
         Col9,Col10,Col12,Col13,Col14,Col15,Col20,Col21,Col22,Col23
  where Col10="&$C$1&"
    and Col22 != 'Duplicado'
     or Col1 contains 'not working'"))

这篇关于当我在表格中使用查询导入范围时如何显示个性化消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 23:11