Average Age using decimals

tcarwardine

New Member
Joined
Jul 13, 2016
Messages
26
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi

I have been given a sheet of ages and asked to calculate the average. However the ages are in decimals e.g. 10.04 = 10 years and 4 months, 11.11 = 11 years and 11 months.

Any ideas how to calculate an accurate average in excel?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
For your example, the average is 11 years and 1.5 months. How would you want to display that result?

Also,
- For the original data how is an exact number of years shown? Is it 11.00?
- Is the data stored as text values or are they actual numbers, perhaps formatted to show 2 decimal places?
 
Last edited:
Upvote 0
For your example, the average is 11 years and 1.5 months. How would you want to display that result?

Also,
- For the original data how is an exact number of years shown? Is it 11.00?
- Is the data stored as text values or are they actual numbers, perhaps formatted to show 2 decimal places?

I would like to display it as 11.015

They are currently numbers to 2dp but can change that if required.
 
Upvote 0
Ok, try this formula. I've given 2 examples.

Average Age

ABC

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:56px;"><col style="width:18px;"><col style="width:65px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]1[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]
[TD="align: right"]10.04[/TD]

[TD="align: right"]11.015[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]3[/TD]
[TD="align: right"]11.11[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]4[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]5[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]6[/TD]
[TD="align: right"]10.04[/TD]

[TD="align: right"]12.032[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]7[/TD]
[TD="align: right"]11.00[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]8[/TD]
[TD="align: right"]15.10[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]9[/TD]
[TD="align: right"]12.03[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]10[/TD]
[TD="align: right"]11.11[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
C2=INT(SUMPRODUCT(INT(A2:A3)+(A2:A3-INT(A2:A3))/12*100)/COUNT(A2:A3))+(SUMPRODUCT(INT(A2:A3)+(A2:A3-INT(A2:A3))/12*100)/COUNT(A2:A3)-INT(SUMPRODUCT(INT(A2:A3)+(A2:A3-INT(A2:A3))/12*100)/COUNT(A2:A3)))*12/100
C6=INT(SUMPRODUCT(INT(A6:A10)+(A6:A10-INT(A6:A10))/12*100)/COUNT(A6:A10))+(SUMPRODUCT(INT(A6:A10)+(A6:A10-INT(A6:A10))/12*100)/COUNT(A6:A10)-INT(SUMPRODUCT(INT(A6:A10)+(A6:A10-INT(A6:A10))/12*100)/COUNT(A6:A10)))*12/100

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Amazing, thank you so much
 
Upvote 0
Hi, just another option you can try, word of warning though, as written this will treat blank cells as zero's when doing the averaging.


Excel 2013/2016
ABC
1
210.0411.015
311.11
4
5
610.0412.032
711
815.1
912.03
1011.11
SQL orig inv & cost
Cell Formulas
RangeFormula
C2=DOLLARFR(AVERAGE(DOLLARDE(CHOOSE({1},A2:A3),12)),12)
C6=DOLLARFR(AVERAGE(DOLLARDE(CHOOSE({1},A6:A10),12)),12)
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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