Replicating YEARFRAC() function from Excel in Python
问题 So I am using python in order to automate some repetitive tasks I must do in excel. One of the calculations I need to do requires the use of yearfrac(). Has this been replicated in python? I found this but it is incorrect for the value I tried. (From 12/19/2011 to 3/31/17, yearfrac() gives 5.2833333333333300000, but the python function in the link gives 5.2807978099335156.) 回答1: I found an e-mail thread from actual Office developers providing a VBA implementation of the YEARFRAC algorithm.