+ Reply to Thread
Results 1 to 6 of 6

Need help on countif and sumif function with dates and wildcard characters

  1. #1
    Registered User
    Join Date
    07-19-2006
    Posts
    2

    Need help on countif and sumif function with dates and wildcard characters

    Hi,

    I have 2 columns of data in sheet 1 as follows:
    Col B Col C
    Open 08/30/05
    Closed 08/01/05
    Closed 08/30/05
    Open 08/03/05
    Closed 07/01/05
    Closed 07/02/05

    In sheet 2, I would like to count how many cells:
    1. have august as their dates
    2. areopen on the month of august
    3. are closed on the month of august
    4. etc.

    so far, i'm trying this countif and sumif formula out, but it doesn't work.
    1. =COUNTIF(Sheet1!$C$1:$C$65000,"08/**/**")
    2. =SUM(IF((Sheet1!$B$1:$B$65000="Open"),IF(Sheet1!$C$1:$C$65000="08/**/**",1,0)))
    3. =SUM(IF((Sheet1!$B$1:$B$65000="Closed"),IF(Sheet1!$C$1:$C$65000="08/**/**",1,0)))

    i don't know if it's the wildcard characters, or if it's the format of my date. please help!! thanks!!
    Last edited by chinita_jill; 07-19-2006 at 11:51 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094
    Try SUMPRODUCT,


    =SUMPRODUCT((A1:A6="Open")*(MONTH(B1:B6)=8))

    Change the "Open" to "Closed" to count the closed. If you want to see a different month then change the 8 in the formula to the corresponding month # (Jan=1,Feb=2,Mar=3.....Dec=12).

    HTH

    Steve

  3. #3
    Registered User
    Join Date
    07-19-2006
    Posts
    2
    thanks steve. unfortunately, your formula returns "#VALUE!"

    any idea why this happens?

  4. #4
    Barb Reinhardt
    Guest

    RE: Need help on countif and sumif function with dates and wildcard ch

    Let's say your dates are in rows 2-7 for this example

    > 1. have august as their dates

    =SUMPRODUCT(--(C$2:C$7>=DATE(2005,8,1)),--(C$2:C$7<=DATE(2005,8,30)))
    > 2. open on the month of august

    =SUMPRODUCT(--(C$2:C$7>=DATE(2005,8,1)),--(C$2:C$7<=DATE(2005,8,30)),--(B$2:B$7="Open"))
    > 3. closed on the month of august

    =SUMPRODUCT(--(C$2:C$7>=DATE(2005,8,1)),--(C$2:C$7<=DATE(2005,8,30)),--(B$2:B$7="Closed"))
    > 4. etc.



    "chinita_jill" wrote:

    >
    > Hi,
    >
    > I have 2 columns of data in sheet 1 as follows:
    > B C
    > Open 08/30/05
    > Closed 08/01/05
    > Closed 08/30/05
    > Open 08/03/05
    > Closed 07/01/05
    > Closed 07/02/05
    >
    > In sheet 2, I would like to count how many cells are:
    > 1. have august as their dates
    > 2. open on the month of august
    > 3. closed on the month of august
    > 4. etc.
    >
    > so far, i'm trying this count if formula out, but it doesn't work.
    > 1. =COUNTIF(Sheet1!$C$1:$C$65000,"08/**/**")
    > 2.
    > =SUM(IF((Sheet1!$B$1:$B$65000="Open"),IF(Sheet1!$C$1:$C$65000="08/**/**",1,0)))
    > 3.
    > =SUM(IF((Sheet1!$B$1:$B$65000="Closed"),IF(Sheet1!$C$1:$C$65000="08/**/**",1,0)))
    >
    > i don't know if it's the wildcard characters, or if it's the format of
    > my date. please help!! thanks!!
    >
    >
    > --
    > chinita_jill
    > ------------------------------------------------------------------------
    > chinita_jill's Profile: http://www.excelforum.com/member.php...o&userid=36536
    > View this thread: http://www.excelforum.com/showthread...hreadid=562912
    >
    >


  5. #5
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094
    Did you change the range in the formula to mathc yours?

    =SUMPRODUCT((B1:B6="Open")*(MONTH(C1:C6)=8))


    If you are concerned with the year as well as the month then,

    =SUMPRODUCT((B1:B6="Open")*(MONTH(C1:C6)=8)*(YEAR(C1:C6)=2005))

    HTH

    Steve

  6. #6
    Valued Forum Contributor
    Join Date
    03-25-2004
    Location
    Boston, MA US
    Posts
    1,094
    One other thing, your ranges need to be the same size (B1:B6, C1:C6). If you tried something like B1:B6 and C1:C11, it would return the VALUE error too.


    HTH
    Steve

+ 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