But the voter turnout was just 13.65%.
The election was held following the death of George Roberts, 68, who died in September after a short illness.
Mr Andrew said: "I am delighted, and proud, to have been elected to represent the people of Hillhead.
"After the tragic death of George Roberts I know that I have big boots to fill, but it is a challenge I am looking forward to.
"I would like to thank the people of Hillhead for giving me the opportunity to represent everyone in the area.
"I would also like to thank my campaign team and all those who made this election win possible."
The by-election was run on the Single Transferable Vote (STV) system, in which candidates are listed in order of preference.
Mr Andrew was elected with 1026 votes, followed by Labour's Martin McElroy with 945, then Stuart Leckie, of the Green Party on 435. Maya Forrest, of the Conservatives, got 372 and Ewan Hoyle, of the LibDems, 307.
Ukip Scotland's Neil Craig had 36 votes and Britannica's Charles Baillie had 11.
Mr McElroy said: "Congratulations to the winning candidate, but I am delighted to have helped boost the Labour vote by more than 5% and come within 80 votes of making this a Labour gain."