+ Reply to Thread
Results 1 to 12 of 12

Counting Dates that Fall in Specific Quarter

  1. #1
    Registered User
    Join Date
    03-07-2013
    Location
    San Antonio
    MS-Off Ver
    Excel 2010
    Posts
    45

    Counting Dates that Fall in Specific Quarter

    Good morning,

    I am trying to come up with a formula. I have dates in rows 1-86. in 88 and 89 I want to put the count of dates that fall into Q1 and Q2 respectively. I have an example below. I think all I need is a table or something showing all 2013 dates converted to numberical values so I can plug them into a countif formula, but not sure.

    thanks!

    Book1.xlsx

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Counting Dates that Fall in Specific Quarter

    Assuming Quarter 1 = Jan 1st to March 31st try this formula

    =SUMPRODUCT(0+(TEXT(B1:B86,"mmm;;")={"jan","feb","mar"}))

    change the month names for quarter 2

    It's not year specific......
    Audere est facere

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Counting Dates that Fall in Specific Quarter

    =countifs($b$1:$b$86, ">=" & --"1/1/13", $b$1:$b$86, "<=" & --"3/31/13")
    Entia non sunt multiplicanda sine necessitate

  4. #4
    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: Counting Dates that Fall in Specific Quarter

    Try for Q1.

    =SUMPRODUCT((B1:B86>=41275)*(B1:B86<=41364))
    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.

  5. #5
    Registered User
    Join Date
    03-07-2013
    Location
    San Antonio
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Counting Dates that Fall in Specific Quarter

    Thank you! This works. By chance, would it be too difficult to explain to me how this formula works? I'm not too familiar with array formulas.

    Thanks,

  6. #6
    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: Counting Dates that Fall in Specific Quarter

    ..I'm not too familiar with array formulas.
    No one of the above formulas is ARRAY formula(meaning no need to confirm as an array formula)... Which one you like to explain?

  7. #7
    Registered User
    Join Date
    03-07-2013
    Location
    San Antonio
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Counting Dates that Fall in Specific Quarter

    =SUMPRODUCT(0+(TEXT(B1:B86,"mmm;;")={"jan","feb","mar"}))

    This is the formula that worked well that i would like more explanation on.

  8. #8
    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: Counting Dates that Fall in Specific Quarter

    ...This is the formula that worked well that i would like more explanation on.
    The 2 really Excel Guru that offered 2 different suggestion will also confirm to you that:

    1) ALL 3 formulas give the same result.

    2)It's better to go with COUNTIFS suggestion as in fact SUMPRODUCT is an ARRAY formula and it is much more faster than SUMPRODUCT.

    Depents of your date format you could try it in this way.

    =COUNTIFS($B$1:$B$86, ">=" & --"01/01/2013", $B$1:$B$86, "<=" & --"31/03/13")

  9. #9
    Registered User
    Join Date
    03-07-2013
    Location
    San Antonio
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Counting Dates that Fall in Specific Quarter

    THanks for the advice!

  10. #10
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Counting Dates that Fall in Specific Quarter

    Here's another one...

    Entered in B88 and copied down:

    =SUMPRODUCT(--(B$1:B$86<>""),--(LOOKUP(MONTH(B$1:B$86),{0,4,7,10},"Q"&{1,2,3,4})=A88))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  11. #11
    Registered User
    Join Date
    03-07-2013
    Location
    San Antonio
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Counting Dates that Fall in Specific Quarter

    shg,

    Thank you for the formula. I was wondering if you could tell me what the "& --" does? I am not familar with that expression.

    Thanks,

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Counting Dates that Fall in Specific Quarter

    It coerces the string that looks like a date into an Excel serial date (i.e., a number) in preparation for comparing it to other dates.

+ 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