+ Reply to Thread
Results 1 to 7 of 7

COUNTIFS to filter age categories

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

    Post COUNTIFS to filter age categories

    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 help

    SAMPLE DATA.xlsx

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: COUNTIFS to filter age categories

    hi DonExcel, welcome to the forum. try this in D5:
    =COUNTIFS(DATA!$B$3:$B$5,D$4,DATA!$C$3:$C$5,">=15",DATA!$C$3:$C$5,"<=19",DATA!$D$3:$D$5,$A5)

    you need to have 2 ranges. also, instead of typing in "M" & the height, i referred them to the cells

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

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

    Re: COUNTIFS to filter age categories

    Hi Benishiryo,

    Thanks I like the cell referencing idea but it still doesn't work and pick up any one who is within that age category 15-19....is there way we can use AND function with it?

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: COUNTIFS to filter age categories

    Can you upload example workbook?

  5. #5
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: COUNTIFS to filter age categories

    I like SUMPRODUCT..

    =SUMPRODUCT((DATA!$D$3:$D$5=$A5)*(DATA!$C$3:$C$5>=B$2)*(DATA!$C$3:$C$5<=B$3)*(DATA!$B$3:$B$5=B$4))
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

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

    Re: COUNTIFS to filter age categories

    Hi Fotis

    Thanks sum product came through for age categories(0-14,15-19,20-24) but not for greater or equal 25 how else can we rework it to pick >=25

  7. #7
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: COUNTIFS to filter age categories

    So we'll do a slight modification to columns for ages >25.

    =SUMPRODUCT((DATA!$D$3:$D$5=$A5)*(DATA!$C$3:$C$5>=H$2)*(DATA!$B$3:$B$5=H$4))
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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