Domenic's method will work for my situation but when I tried using it in another worksheet I had a problem with the INDIRECT function. For some reason it does not like the text part "1:" (result is #value). Any idea why it was working in one worksheet, but not the other. The cells seam to be formated the same.
Are you still using defined references for the second sheet or have you dispensed with them and using them in the formula itself? If so, you'll have to confirm the formula with CONTROL+SHIFT+ENTER, not just ENTER.
Also, following Aladin's lead, my solution can be modified to allow an unequal number of empty cells...
1) Add the following defined reference...
Name: Num
Refers to: =MIN(COUNT(Sheet1!$D$15:$K$15),COUNT(Sheet1!$D$14:$K$14))
Change the following defined references...
Array1:
=SUBTOTAL(9,OFFSET(Sheet1!$D$15:$K$15,,SMALL(IF(ISNUMBER(Sheet1!$D$15:$K$15)*ISNUMBER(Sheet1!$D$14:$K$14),COLUMN(Sheet1!$D$15:$K$15)-COLUMN(Sheet1!$D$15)),ROW(INDIRECT("1:"&Num))),,1))
Array2:
=SUBTOTAL(9,OFFSET(Sheet1!$D$14:$K$14,,SMALL(IF(ISNUMBER(Sheet1!$D$15:$K$15)*ISNUMBER(Sheet1!$D$14:$K$14),COLUMN(Sheet1!$D$14:$K$14)-COLUMN(Sheet1!$D$14)),ROW(INDIRECT("1:"&Num))),,1))
Hope this helps!