Introductory use (implying connection to something previous) was in Old English. To represent vulgar or colloquial pronunciation often written an', 'n'. Phrase and how as an exclamation of emphatic agreement dates from early 1900s.
masc. proper name, from Old French Andreu (Modern French André), from Late Latin Andreas (source also of Spanish Andrés, Italian Andrea, German Andreas, Swedish and Danish Anders), from Greek Andreas, a personal name equivalent to andreios (adj.) "manly, masculine, of or for a man; strong; stubborn," from anēr (genitive andros) "man" (from PIE root *ner- (2) "man").
Nearly equivalent to Charles. Andrew Millar (1590s) for some forgotten reason became English naval slang for "government authority," and especially "the Royal Navy." St. Andrew (feast day Nov. 30) has long been regarded as patron saint of Scotland; the Andrew's cross (c. 1400) supposedly resembles the one on which he was crucified.
1620s, "womanish" (of a man); 1650s, "having two sexes, being both male and female," from Latin androgynus, from Greek androgynos "hermaphrodite, male and female in one; womanish man;" as an adjective (of baths) "common to men and women," from andros, genitive of anēr "male" (from PIE root *ner- (2) "man") + gynē "woman" (from PIE root *gwen- "woman"). Related: Androgynal (1640s).
"a buffoon; a zany; a jack-pudding" [Johnson], "One whose business it is to make sport for others by jokes and ridiculous posturing" [Century Dictionary], according to OED, in early use properly a mountebank's assistant, 1670s, from merry + masc. proper name Andrew, but there is no certain identification with an individual, and the name here may be generic.