Google-sheets – Import table using IMPORTXML

google sheetsimportxml

I am trying to import a table from the lower part of following website to Google Sheets:
http://www.etnet.com.hk/www/tc/warrants/search_cbbc_hsi.php

I used the formula:

=IMPORTXML("http://www.etnet.com.hk/www/tc/warrants/search_cbbc_hsi.php","//td//a")

but the output is messy and contains many other data outside the table.

Anyone help?

Best Answer

You seem to have forgotten to mention what you would consider tidy, but it should be easier to handle your data (assumed to be starting in A1) with a formula such as:

=offset(A1,int(2*((row()-1)/2)),0)

in B1 and the same again in C1 with an extra +1 immediately before the ,0 - both copied down to suit.

OFFSET
INT
ROW