DatedIf Column in yymm format requiring to be averaged

isassy16

New Member
Joined
Jul 13, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I have been trying to solve this for several days now. I have a column of 'time served in position' that was calculated via a DatedIf formula and I need it in the yymm output. 5y3m, 1y2m and so on. I then need the average of all the time served in position below but it keeps giving me an error code. Can I not do an average of datedif values in yymm format? Snippet of column attached. Thank you for any insight on this.
1689277467351.png
1689277445840.png
1689277519072.png
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Just use month as a result .... then you can average that, and convert to ym afterwards.
 
Upvote 0
I would also use a helper column showing the difference in months.
Your issue is that you are years / months are text and you can't average text.

If you really want to keep it the way it is you could try something like this:

20230714 Date ym average isassy16.xlsx
JK
1Current Years in positionAverage
21y9m4y9m
33y10m
44y9m
52y10m
65y10m
74y6m
810y3m
Sheet1
Cell Formulas
RangeFormula
K2K2=LET(avgmths,SUM(TEXTBEFORE(J2:J8,"y")*12,--TEXTBEFORE(TEXTAFTER(J2:J8,"y"),"m"))/COUNTA(J2:J8), avgyrs, INT(avgmths/12), avgyrs & "y" & INT(avgmths-(avgyrs*12)) & "m")
 
Upvote 0
Solution
I would also use a helper column showing the difference in months.
Your issue is that you are years / months are text and you can't average text.

If you really want to keep it the way it is you could try something like this:
 
Upvote 0
Alex Blankenburg, this worked perfectly. So awesome. Thank you so very much!
 
Upvote 0

Forum statistics

Threads
1,215,564
Messages
6,125,579
Members
449,237
Latest member
Chase S

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