4 Replies Latest reply: Aug 24, 2017 8:14 AM by Lorenzo Caravati

# Payback From Number of Months to N. of Years and N. of Months

Good Morning,

I would ask you which is the right way to transform a certain amount of Months (this is a Payback period expressed in Months) in the same amount expressed in Year and Months.

For example 52 Months =  4 years and 4 months.

It is a silly thing but I don't know how I can do it.

Lorenzo

• ###### Re: Payback From Number of Months to N. of Years and N. of Months

Hi Lorenzo,

Not sure how exactly you are wanting to represent the years and months.  If you are wanting to break down to a year field and month field the below will work, you can then combine back if needed.

If 'Payback' is the field name of your number of months.

Calculate Years    = floor(Payback/12)

Calculate Months = Payback- floor(Payback/12)*12

Hope that makes sense and is helpful.

• ###### Re: Payback From Number of Months to N. of Years and N. of Months

Floor((52/12))&' Years and ' &  mod(52,12)&' months'

• ###### Re: Payback From Number of Months to N. of Years and N. of Months

I think round will not work use floor in that place.

floor((52/12))&' Years and ' &  mod(52,12)&' months'

• ###### Re: Payback From Number of Months to N. of Years and N. of Months

Thank you very much to everybody!!!

All your suggestion are right and the KPI is working!

Thanks again!

Lorenzo