• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Median IF - age groups

Dubs

New Member
Hi team, I have a median formula that is removing zero's nicely and is providing a median age.
{=MEDIAN(IF(E383:DA383<>0,$E$10:$DA$10))}

The issue is it seems to also be counting the corresponding ages e10:da10 even if the corresponding row has a zero
ie sales assistants is returning median age of 49.5 instead of around age 25
Col DA is 115yo
There are 487 rows so i would prefer not to do this manually

TIA for assistance
Hopefully to do without a macro as I know nothing about macrs's
 

Attachments

  • chand.PNG
    chand.PNG
    16.9 KB · Views: 4
  • chand1.PNG
    chand1.PNG
    19.9 KB · Views: 3
Last edited:
Yes, this is data freely available from the ABS too.
 

Attachments

  • median age ABS.xlsx
    265.4 KB · Views: 9
You didn't highlight what the issue is?

DD11 should be: =SUMIF(E11:DA11,"<="&DB11,E11:DA11)

No idea what you're trying to do in DE11 ?
 
If as I suspect the Numbers in Columns E:DA are the number of people in each age group working in that job
then D11 should be:
=MEDIAN(IF(E11:DA11<>0,($E$10:$DA$10*E11:DA11)/E11:DA11)) Ctrl+Shift+Enter
 
Yes you were correct regarding the number of persons by age in each job and given that I am seeking a median age of persons employed in each role.
Thanks for your help. Col DC onwards was testing.

the formula for D11 gives the same result as my original formula -

does the bold portion of your formula $E$10:$DA$10*E11:DA11)/E11:DA11 cancel itself out?
 
No
It weights the Number of workers by the age, to give you a weighted average age to which median applies

If you copy it down it fixes the issues in lower cells
 
Hi ,

See the attached file.

There is still a problem or two ; I have seen that in the case of row 323 , the MATCH function , which has been used with a third parameter of 1 , returns the correct value , but the formula , which does not see an exact match anywhere else , has not been made for this. It can be revised , but I don't think a case or two like this matters.

If you want the formula to be revised , let me know.

Narayan
 

Attachments

  • Book 1.xlsx
    887.1 KB · Views: 3
Back
Top