Search code examples
exceldateexcel-formulaexcel-2013

Add year month combination as decimals in excel


i have an excel sheet with values in a column as 1.11 which implies it is 1 year and 11 months. I want to add these values and get the result in year terms - for example 1.11 + 2.1 should be equal to 4 and not 3.31.

Any help is greatly appreciated.

Name    Total_Time_spent    
A   1.11
B   2.1 
C   0.3
D   0.5

When i add i get 4.01 however i want to get 4.8 which implies it is four years eight months.


Solution

  • You will need to parse it as if it were a text string and add the parts back together to get what you want:

    =--(SUMPRODUCT(--LEFT(B1:B4,FIND(".",B1:B4)-1))+INT(SUMPRODUCT(--MID(B1:B4,FIND(".",B1:B4)+1,2))/12)&"." &MOD(SUMPRODUCT(--MID(B1:B4,FIND(".",B1:B4)+1,2)),12))
    

    enter image description here