
Yan (Y. K. Yen) first studied at a school founded by William J. Boone. At age 14, he was brought to the United States, where he graduated with honors from Kenyon College in Ohio in 1861. He returned to China in 1862 during the American Civil War and worked as a translator for a foreign company in Shandong while serving as a volunteer preacher at the Church of Our Savior in Shanghai. In 1866 he served at the Anglican church in Wuchang, Hubei, and was ordained a priest in 1870. He was responsible for the planning and building of Boone School in Wuchang. He returned to Shanghai in 1878 to help in the planning and development of St. John's College (founded in 1879). While serving as dean of the school for eight years, he taught mathematics and natural philosophy. From 1887 to 1898, Yan pastored the Church of Our Savior.
Yan and his wife were the only two Chinese at the third General Missionary Conference held in Shanghai in May 1890. Yan urged missionaries to "adopt a Chinese mode of life" and not to be overbearing in manner. A controversial issue at the conference was ancestor worship. Yan opposed any compromise, explaining that he did not even have pictures of his parents in his house lest non-Christians misinterpret the act as idolatry. He went to England in 1894 as a representative of the Chinese church and urged the British to ban opium. Yan and some others built a garden for the Chinese because the British forbade them to enter their garden in the British settlement.
Yan translated many books during his lifetime, including one on educational theory as well as many Christian books. He and his wife had five sons and a daughter, all educated either in the United States or in England. One of his sons, Huiqing (W. W. Yen), was a scholar and an ambassador to the Soviet Union from 1933 to 1936.