+ Reply to Thread
Results 1 to 11 of 11

Countifs Formula needed to count # of dates in same month that also is in same state.

  1. #1
    Registered User
    Join Date
    11-11-2014
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Countifs Formula needed to count # of dates in same month that also is in same state.

    I have a spreadsheet with multiple columns. I do not want to manipulate the data in any way. On a separate spreadsheet, I need a CountIfs Formula to identify all the dates in column I that are in January,that also have Alabama in Column D.

    I tried this formula, but it did not work: =COUNTIFS('DD Market Analysis'!D:D,Stats!A2,'DD Market Analysis'!I:I,MONTH('DD Market Analysis'!I:I)=1)

    Note: I do not want to use an Array for this.

    Thanks for the help.

    Stan

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Countifs Formula needed to count # of dates in same month that also is in same state.

    Hi Stan,

    A Pivot Table seems like a very quick and easy answer for this problem. Give me a sample of your data and it is a "no formulas needed" answer.
    To attach a sample workbook, click on Go Advanced and then on the Paper Clip Icon above the advanced message area.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,578

    Re: Countifs Formula needed to count # of dates in same month that also is in same state.

    Try this,
    =COUNTIFS('DD Market Analysis'!D:D,Stats!A2,'DD Market Analysis'!I:I,">="&DATEVALUE("1/1/14"),'DD Market Analysis'!I:I,"<="&DATEVALUE("31/1/14")

  4. #4
    Registered User
    Join Date
    11-11-2014
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Re: Countifs Formula needed to count # of dates in same month that also is in same state.

    Hey Marvin,

    Thank you for the quick response, but I cannot use Arrays or Pivot Tables for this. It needs to be something that I do not have to alter the original data/spreadsheet.

    Let me know if you have any other ideas.

    Thanks again.

  5. #5
    Registered User
    Join Date
    11-11-2014
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Re: Countifs Formula needed to count # of dates in same month that also is in same state.

    Hey,

    Thanks for the feedback, this actually returned 0, when there are records in the specified column that would qualify. Any other ideas we could try?

    Thanks again.

  6. #6
    Registered User
    Join Date
    02-17-2012
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Countifs Formula needed to count # of dates in same month that also is in same state.

    you my have to "kick it old school" and use SUMPRODUCT to force a result.

    Try:
    =SUMPRODUCT(--(MONTH('DD Market Analysis'!I:I)=1),--('DD Market Analysis'!D:D=Stats!A2))

    (I am assuming, based on your post that 'DD Market Analysis'!I:I is the rage containing the dates, 'DD Market Analysis'!D:D is the range containing the states, and Stats!A2 is a cell containing Alabama)

  7. #7
    Registered User
    Join Date
    11-11-2014
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Re: Countifs Formula needed to count # of dates in same month that also is in same state.

    That is very perceptive of you. I am getting an error on this formula though.

    Any thoughts on how to correct it?

  8. #8
    Registered User
    Join Date
    02-17-2012
    Location
    Ottawa, Canada
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Countifs Formula needed to count # of dates in same month that also is in same state.

    sorry, missed some single quotes.

    =SUMPRODUCT(--(MONTH('DD Market Analysis'!I:I)=1),--('DD Market Analysis'!D:D='Stats'!A2))

  9. #9
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Countifs Formula needed to count # of dates in same month that also is in same state.

    How about using an helper column in Sheet DD Market Analysis
    to show Months of days using following formula in any corresponding column
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Drag down
    Assuming you will do it in column K
    The Formula in sheet Stats would be
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Using Helper column is fastest and easy...

    Regards,
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  10. #10
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Countifs Formula needed to count # of dates in same month that also is in same state.

    Pivot Tables don't make you alter the original data.

  11. #11
    Registered User
    Join Date
    11-11-2014
    Location
    Atlanta, GA
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Re: Countifs Formula needed to count # of dates in same month that also is in same state.

    I will be deleting the data and pasting new data in the "original data's" place monthly. Where there may be 90 rows that qualify this month, there could be 120 next month and with a pivot table that depends on specific fields being the same, it would not work.

    thanks for the follow up though.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Formula needed to calculate working days in specified month between two dates
    By webfeet2 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-24-2013, 02:19 AM
  2. [SOLVED] Formula to count number of nights falling in each month from arrival and departure dates
    By zicitron in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-28-2013, 02:16 AM
  3. Replies: 3
    Last Post: 07-19-2010, 01:02 PM
  4. Replies: 5
    Last Post: 05-12-2009, 09:37 AM
  5. FORMULA NEEDED TO COUNT DAYS IN EXCEL BETWEEN DATES
    By Rhonda1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-30-2006, 08:20 PM

Tags for this Thread

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