+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    01-30-2009
    Location
    Sheffield, England
    MS-Off Ver
    Excel 2003
    Posts
    4

    Dates and groups

    Hi All,

    I want to be able to work out how many people have a birthday in each month based on 2 criteria

    In column A i have people's birthdays, in column B i have a category e.g. Red, Blue, Green

    Is there any way that i can work out how many people have a birthday in August who are in the Green group?

    It doesn't matter what year they were born in just the month.

    Thanks in advance

  2. #2
    Valued Forum Contributor
    Join Date
    10-14-2004
    Location
    San Diego, CA
    Posts
    213

    Re: Dates and groups

    Hello Smurfy:

    The SUMPRODUCT() function should wrok for you.

    Type these dates in cells D1 through O1, 1/1/1900, 2/1/1900, 3/1/1900... You can use custom formatting ( mmm ) so the dates look like so, Jan, Feb, Mar…

    Type the colors in cells C2, C3 and C4 respectively.

    Paste this formula in cell D2 then copy down and across to cell O4.
    Code:
    =SUMPRODUCT(--(MONTH($A$2:$A$1000)=MONTH(D$1)),--($B$2:$B$1000=$C2))

  3. #3
    Forum Guru contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2010
    Posts
    1,335

    Re: Dates and groups

    In the blue array used:
    =IF(D2=C1:C31,IF(MONTH(B1:B31)=INDEX({1,2,3,4,5,6,7,8,9,10,11,12},MATCH(E2,I5:I16,0)),A1:A31,""),"")
    It is a simple formula

    This one is little complicated (brown array).
    =INDEX(A1:A31,SMALL(IF(IF(D2=C1:C31,IF(MONTH(B1:B31)=INDEX({1,2,3,4,5,6,7,8,9,10,11,12},MATCH(E2,I5: I16,0)),A1:A31,""),"")="","",ROW()),ROW(1:31)))

    I think u'll see difference between 'em when u see attached file

    Note. Both of 'em are array formulas and need to be conbirmed w/CTRL+SHIFT+ENTER.

    PS: Type the formula, then select 31 rows (coz u've got 31 names), press F2 then CTRL+SHIFT+ENTER.
    Attached Files Attached Files
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, «Born in USSR»
    Vusal M Dadashev

    Baku, Azerbaijan

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.2.0