So called from Andrew Borde, physician to Henry VIII., etc. To vast learning he added great eccentricity, and in order to instruct the people used to address them at fairs and other crowded places in a very ad captandum way. Those who imitated his wit and drollery, though they possessed not his genius, were called Merry Andrews, a term now signifying a clown or buffoon. Andrew Borde Latinised his name into Andreas Perforatus. (1500-1549.) Prior has a poem on “Merry Andrew.”
The above is the usual explanation given of this phrase; but Andrew is a common name in old plays for a varlet or manservant, as Abigail is for a waiting gentlewoman.
Source: Dictionary of Phrase and Fable, E. Cobham Brewer, 1894