+ Reply to Thread
Results 1 to 6 of 6

COUNTIFS not working

  1. #1
    Registered User
    Join Date
    01-13-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    COUNTIFS not working

    In A2 I have a date and in A3 a text string. This continues down the sheet (A4 a date, A5 text, etc). I'm trying to figure out how to create a COUNTIFS formula that will increase the count if the date is in January (or any month for that matter) and the text equals a specific word I enter. As a start I've got:

    COUNTIFS(A2,AND(A2>="1/1/2011",A2<"2/1/2011'),A3,"TEXTHERE")

    However, this does not increase the count (to 1) and also does not evaluate the rest of the sheet. Any suggestions?
    Last edited by nosenga; 01-13-2011 at 04:39 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: COUNTIFS not working

    COUNTIFS is for range...

    For single cell you can use:

    =AND(A2>="1/1/2011",A2<"2/1/2011') + ISNUMBER(FIND("TEXTHERE", A3))

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: COUNTIFS not working

    @zbor, you should be coercing your date strings and I suspect * rather than + the two Booleans (else it's an OR)
    (COUNTIFS will interpret numbers as strings as numbers automatically - which at times is a pain)

    @nosenga, if you want to process a range - given the alternating pattern:

    Please Login or Register  to view this content.
    note that in the above the text search is case insensitive unlike your FIND - if it's important let us know.

  4. #4
    Registered User
    Join Date
    01-13-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: COUNTIFS not working

    DonkeyOte,

    Thank you, that formula works great. However, I'm not sure where the end of the sheet is going to be (I'm creating this for someone else to use). Is there anyway to say A2:infinity?

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: COUNTIFS not working

    Build in some spare capacity but entire column references aren't really viable given the alternating requirements of the ranges (A2:A100 & A3:A101)

    So perhaps something like:

    Please Login or Register  to view this content.
    COUNTIFS is pretty efficient so large ranges like the above aren't really an issue.

    Note: it is imperative that all ranges share the same dimensions - in the above that is 999999x1

  6. #6
    Registered User
    Join Date
    01-13-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: COUNTIFS not working

    Ok, basically just end with a number very out of reach, making sure to continue with the even/odd pattern.

    Thanks again!

+ 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