I am looking to understand what the correct syntax would be for a formula for a Google Spreadsheets that would use the IF THEN function inside of an IMPORTRANGE formula.

I want to import all of the part numbers from column C of workbook 1, sheet 1, and stick them into column C, sheet 1 or workbook 2

I would like to see about a formula that would only pull the cells that have content, while also leaving all the additional blank cells behind.

  • If the cell doesn't have content, then it will pull a blank cell. There is no need to specify that in the formula. – Karthik VU Dec 16 '13 at 4:08
  • 1
    I understand that if the cell is empty it will leave the corresponding cell blank. I was hoping to be able to omit all the empty cells during the import. – WinterWierdo Dec 16 '13 at 4:49

I would use the following formula.


   "SELECT Col1 WHERE Col1 <> ''"

=QUERY(IMPORTRANGE("0Anrm0HgYyzzRdGR3TWpBelFCenJYM01ZUDZsaWNsTkE", "Sheet1!C3:C13"),"SELECT Col1 WHERE Col1 <> ''")


The QUERY formula will take the dataset obtained from the IMPORTRANGE formula and show the first column (Col1) only where Col1 has an entry.


I've added my solution into your file.


QUERY would try to determine character/numeric type of each column. If you have columns that have mixed text and number in cells, with numbers at start, it would be decided as numeric, and text cells replaced with blanks.

  • hey @jacob thanks for your help! – WinterWierdo Dec 18 '13 at 2:41
  • would you also be able to help me with a QUERY formula to pull a column from same workbook, different sheet? I cant seem to understand it... – WinterWierdo Dec 18 '13 at 2:45

Use =filter(A8:A15,A8:A15<>"") but replace A8:A15 with the import.

So =filter(ImportRange("0Anrm0HgYyzzRdGR3TWpBelFCenJYM01ZUDZsaWNsTkE";"Sheet1!C3:C13"),ImportRange("0Anrm0HgYyzzRdGR3TWpBelFCenJYM01ZUDZsaWNsTkE";"Sheet1!C3:C13")<>"")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.