+ Reply to Thread
Results 1 to 5 of 5

COUNTIF for multiple criteria with date range

  1. #1
    Registered User
    Join Date
    04-13-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    74

    COUNTIF for multiple criteria with date range

    Hi,

    I would like to your kind assistance on the following

    My worksheet has multiple columns

    Column F - date (format dd-mmm)
    Column K - product name e.g. PIL, DCPIL etc
    Column X - status =1

    Column F Column K Column X
    1-Mar PIL 1
    3-Mar DCPIL 1
    15-Mar PIL 1
    20-Mar PIL 1
    30-Mar DCPIL 1
    2Apr PIL 1

    Can anyone help to advise the formula (is it possible to use COUNTIF) on how to count the number of status = "1" for the period (1 Mar-15 Mar) with product name "PIL"
    The answer I want should be "2"

    Thanks

    Pjlau

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: COUNTIF for multiple criteria with date range

    Hi pjlau,

    You can use the below formula:-

    {=SUM(--($A$1:$A$6>=A1)*($A$1:$A$6<=A3)*($B$1:$B$6=B1))}

    It's an arrray formula and need to be entered using key combination Ctrl Shift Enter.

    where A1 is 01 Mar and A3 is 15 Mar, B1 = PIL...

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    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: COUNTIF for multiple criteria with date range

    Hi

    As you are in Excell 2003, try to use SUMPRODUCT function.

    If you can not handle this, then upload a small sample workbook to show you the way to do this.
    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.

  4. #4
    Registered User
    Join Date
    04-13-2012
    Location
    Hong Kong
    MS-Off Ver
    Excel 2003
    Posts
    74

    Re: COUNTIF for multiple criteria with date range

    Thx.

    Sorry I am new to Excel.

    As you said "where A1 is 01 Mar and A3 is 15 Mar" , how to define if the period is Apr?

    Thanks /pjlau

  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: COUNTIF for multiple criteria with date range

    Try also SUMPRODUCT

    In H1, type your start day

    In I1, type your End Date.

    Then use this formula.

    =SUMPRODUCT(($K$1:$K$1000="pil")*($F$1:$F$1000>=H1)*($F$1:$F$1000<=I1))

    Same way for dilipandey's Formula

+ 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