5
votes

I want to import a range from another Google sheet, but to ignore empty cells so that the data prints back to back (versus having big gaps created from importing empty cells). Here is my formula (Google link changed for confidentiality):

=IMPORTRANGE("https://docs.google.com/spreadsheets/d/dalsfjasfdjjasfd/edit#gid=76574001",
 "Course_Schedule!F2:F77")

Put another way, import range of about result would be: blank cell, blank cell, 25, 43, blank cell

When I want it to be: 25, 43

2

2 Answers

5
votes

=QUERY(IMPORTRANGE("1GVsBuYlJk2wxKgYjA2k_6ZlBoZ17frwyktfP6a0lUao",
 "Course_Schedule!F2:F77"), "select Col1 where Col1 is not Null", 0)

4

0
votes

This might help:

=filter(IMPORTRANGE("https://docs.google.com/spreadsheets/d/dalsfjasfdjjasfd/edit#gid=76574001", "Course_Schedule!F2:F77"), IMPORTRANGE("https://docs.google.com/spreadsheets/d/dalsfjasfdjjasfd/edit#gid=76574001", "Course_Schedule!F2:F77")<>"") 

The filter in this formula would set the criteria to ignore blank cell (<>""), therefore, allowing you to get your desired results