Forum Discussion

jenniferk007's avatar
jenniferk007
Copper Contributor
Jul 27, 2022

Convert from Google Sheets using IFERROR not working

Asking the experts why a formula working in Google Sheets fails to work in an Excel file that has been downloaded? Here is the formula working in Sheets:

 

=IFERROR(Query('TAB1'!A2:K,"Select A,C,D,J,K where G <>'' ",1),"No records found")


Does Excel require something different in the syntax?

 

The formula looks for a filled in cell in G column in TAB1, then transfers the entire row of data into TAB2 where the formula is hiding. This works flawlessly in Google Sheets. However, it does not work as it is shown in the downloaded Excel file.

 

When I open the downloaded file with Excel, I see this message "We found a problem with some content in 'Your_File.xlsx'. Do you want us to try to recover as much as we can? If you trust the source of this workbook, click Yes."

 

Also the formula in the downloaded Excel version has changed to this:

 

=IFERROR(__xludf.DUMMYFUNCTION("IFERROR(Query('TAB1'!A2:K26,""Select A,C,D,J,K where G <>'' "",1),""No records found"")"),"Standard")

  • mtarler's avatar
    mtarler
    Silver Contributor
    basically google sheet and MS excel are not the same. QUERY doesn't exist in MS excel. Based on the context I would try something like:
    =FILTER('TAB1'!A2:K26, 'TAB1'!G2:G26<>"", "No records found")
    That will return all the columns but if you need only columns A,C,D,J,K then try:
    =FILTER(INDEX('TAB1'!A2:K26,SEQUENCE(25,1,2),{1,3,4,10,11}), 'TAB1'!G2:G26<>"", "No records found")
    • jenniferk007's avatar
      jenniferk007
      Copper Contributor

      Thank you for the reply, but I am getting a "The function isn't valid"error message on the following... the inner parenthesis are lighting up, the set inside of INDEX.

      =FILTER(INDEX('TAB1'!A2:K26,SEQUENCE(25,1,2),{1,3,4,10,11}), 'TAB1'!G2:G26<>"", "No records found")
      • mtarler's avatar
        mtarler
        Silver Contributor

        jenniferk007 I'm not sure what is the issue.  I did find a small error but that just caused it to miss a line not give the error you mentioned.  here is an example in the attached.  I also updated it to use LET() and set the "in" range and sequence automatically on that.  but picking the columns {1,2, ...} on line 4 and the column to check on line 5 is still manual:

        =LET(in,A2:G16,
             FILTER(INDEX(in,
                          SEQUENCE(ROWS(in)),
                          {1,3,4,6,7}),
                     G2:G16<>"",
                     "No records found"))

        I should ask, do you have Excel 365?  If you type =FIL do you see FILTER in the pop up suggestion window?

        Can you attach a sample file and maybe a screenshot of the error.

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    jenniferk007 

    Possibly (You may adjust the ranges to accommodate your data):

    =LET(f,FILTER('TAB1'!A2:K5,'TAB1'!G2:G5<>" "),INDEX(f,SEQUENCE(ROWS(f)),{1,3,4,10,11}))

     

Resources