Closed Thread
Results 1 to 8 of 8

Sorting Ages into Age Groups

  1. #1
    Registered User
    Join Date
    05-29-2009
    Location
    New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    3

    Sorting Ages into Age Groups

    Hi Forum!

    Currently Pivot Table in Excel for our Staff client statistics for the year (columns: staff reference, month, age, age group, gender, ethnicity).

    Since we report by age group I need the age group column to do the following function:

    If Age = <14 then display "0 - 13" in Age Group column
    If Age = 14, 15, 16, 17 then display "14 - 17" in Age Group column
    If Age = >17 then display "18 - 65+" in Age Group column

    All seems very well in theory, but is it practicable/possible?

    Thanks for taking the time to have a look!

    Cheers

    Topaz

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sorting Ages into Age Groups

    Can you post a dummy sample illustrating how you have your PT setup ?

    I'm not sure whether you're talking about PT headers (possibility of using Grouping) or if the Age is an item in a Column (in which case you could possibly use a Custom Format)

  3. #3
    Registered User
    Join Date
    05-29-2009
    Location
    New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Sorting Ages into Age Groups

    Thanks for your reply DonkeyOte - please find file attached.

    Cheers

    Topaz[/FONT]
    Attached Files Attached Files

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Sorting Ages into Age Groups

    Ah I see - you want to populate the column at source...

    D2: =IF(OR(A2="",ISTEXT(C2)),"",LOOKUP(C2,{0,14,17},{"0 - 13","14 - 17","18 - 65+"}))
    copy down as required

  5. #5
    Registered User
    Join Date
    05-29-2009
    Location
    New Zealand
    MS-Off Ver
    Excel 2007
    Posts
    3

    Smile Re: Sorting Ages into Age Groups

    Thank you so much DonkeyOte - you are a star! - now our little non-profit org can report back to our funders without the stresses of manual counting (this was all done on paper a week ago!).

    Cheers and best regards

    Topaz

  6. #6
    Registered User
    Join Date
    06-04-2013
    Location
    Kenya
    MS-Off Ver
    Excel 2013
    Posts
    4

    Post Re: Sorting Ages into Age Groups

    Hi Everyone im trying to do a small analysis
    to nest a countif formula of ages that fall in the following agegroups
    0-14
    14-19
    20-24
    25+

    I have tried using "15-19" or ">=20,<=24" but nothing seems to work
    kindly helpSAMPLE DATA.xlsxSAMPLE DATA.xlsxSAMPLE DATA.xlsx

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Sorting Ages into Age Groups

    DonExcel,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  8. #8
    Registered User
    Join Date
    10-08-2014
    Location
    London
    MS-Off Ver
    Office 2013
    Posts
    1

    Re: Sorting Ages into Age Groups

    Brilliant thanks!

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1