Date format

jmazorra

Well-known Member
Joined
Mar 19, 2011
Messages
715
Hello

Earlier a user helped me with the formula below. It works great, however, the formula's result is a decimal number which needs to be turned into years and months. The formula lies on cell U31 and U30, In U30 I have:

=IF(AVERAGE(IF(K6:K126="y",IF(R6:R126>=1,B6:B126))),AVERAGE(IF(K6:K126="y",IF(R6:R126>=1,B6:B126))),0)

and in U31 I have the following formula:

=AVERAGE(IF('All Employees Annualized'!R6:R127>=1,'All Employees Annualized'!B6:B127),0)

I have to hide this column since I need to see the data in both cells to show in years and months. So, on cell U28 and U27 I have the following formula to turn the decimal into years and months:

=IF(INT(U31),INT(U31)&" Yrs "," 0 Yrs ") &IF(MOD(U31,1),ROUND(12*MOD(U31,1),0) & " Mths"," 0 Mths")

which gives the result as ie: 1 yrs 7 mths

Questions is, is there a way to combine both formulas so that I don't have to hide a column, or is the way I am doing it the only way:
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I would keep the approach you have.

You could change the second formula to

=TEXT(100*dollarfr(U31, 12), "0 ""Yrs "" 00 ""Mths""")
 
Upvote 0
I would keep the approach you have.

You could change the second formula to

=TEXT(100*dollarfr(U31, 12), "0 ""Yrs "" 00 ""Mths""")

Nice 1

Biz
 
Upvote 0

Forum statistics

Threads
1,224,568
Messages
6,179,595
Members
452,927
Latest member
whitfieldcraig

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top