ImportRange Function to Ignore Empty Cells

Thomas Kauer picture Thomas Kauer · Jan 10, 2019 · Viewed 9.8k times · Source

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

Answer

player0 picture player0 · Jan 14, 2019

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

4