Andersen was born on a farm at Ydby, Thisted County, the son of Anders Nielsen (1794–1862) and Ane Margrethe Didriksdatter (1797–1857).
The farm was small and his father therefore had to supplement his income by transporting stone and gravel for the county's road construction.
Andersen was involved in politics from an early age, He was especially committed to the defence agenda and was a board member of the 1884 founded organisation iværksatte selvbeskatning til forsvarssagens fremme.
He wanted the organisation to become a future bulwark against conflict between worker and employer and was involved in the September Settlement which ended the 1899 Great Lockout.
Andersen was also chairman of Entreprenørforeningen, Arbejdsgivernes Ulykkesforsikring, Danske Lloyd, Bankrådet for Laane- og Diskontobanken, and a member of overskatterådet.
In 1877, Andersen acquired the country house Søholm on the northern shores of Lake Emdrup (then Lundehussøen).