+ Reply to Thread
Results 1 to 5 of 5

I need a formula the counts the number of cells that meet 2 conditions ac multiple w/sheet

Hybrid View

  1. #1
    Registered User
    Join Date
    11-28-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    3

    I need a formula the counts the number of cells that meet 2 conditions ac multiple w/sheet

    I am trying to count the number of male and female clients of each age from 11-25 across multiple worksheets.

    This sounds simple, and probably is for someone experienced, but I am an Excel novice and I'm struggling.

    On all worksheets B6 contains the age and D6 contains M or F.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,412

    Re: I need a formula the counts the number of cells that meet 2 conditions ac multiple w/s

    Excel is not very good at 3-D references, as many functions do not work with them. I would suggest that you have a formula in the same cell (eg. X1) in each of your worksheets like this:

    =COUNTIFS(D:D,"M",B:B,">=11",B:B,"<=25")

    which will count the number of males aged between 11 and 25 (inclusive) on that sheet. You can have a similar formula in X2 for females:

    =COUNTIFS(D:D,"F",B:B,">=11",B:B,"<=25")

    Then in a summary sheet you could have a formula like this to count all the males between 11 and 25 from all of your sheets:

    =SUM(first:last!X1)

    where first and last are the names of the sheets which encompass all the other sheets (except for the summary).

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    11-28-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: I need a formula the counts the number of cells that meet 2 conditions ac multiple w/s

    Thanks TMS too, I'm back in the office tomorrow so will give these a try.

    Your help is much appreciated

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,204

    Re: I need a formula the counts the number of cells that meet 2 conditions ac multiple w/s

    You can use COUNTIFS for multiple conditions,for example:

    =COUNTIFS(B:B,">=11",B:B,"<=15",D:D,"M")


    Regards, TMS
    Last edited by TMS; 11-28-2012 at 01:35 PM. Reason: adjust formula
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Registered User
    Join Date
    11-28-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: I need a formula the counts the number of cells that meet 2 conditions ac multiple w/s

    Cheers Pete, I'll have a go with this tomorrow.

+ 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