+ Reply to Thread
Results 1 to 20 of 20

COUNTIFS Error

  1. #1
    Registered User
    Join Date
    07-12-2013
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    29

    COUNTIFS Error

    I am using the following formula:

    =COUNTIFS(Data!$I:$I,">"&B38, Data!$I:$I,"<"&C38+1,Data!$D:$D,"?*",Data!$B:$B,"")

    Data!$I:$I points to the contact date
    B38 points to the first of the month
    C38 points to the last of the month
    Data!$D:$D points a column that has a number or is blank
    Data!$B:$B points to a name or is blank

    My goal is to count the records with a contact date between first and last of the month, with column D not blank and column B blank. The formula is returning zero records, but there should be records.

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: COUNTIFS Error

    try
    =COUNTIFS(Data!$I:$I,">"&B38, Data!$I:$I,"<"&C38+1,Data!$D:$D,"<>",Data!$B:$B,"=")
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    07-12-2013
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: COUNTIFS Error

    It also returns 0

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: COUNTIFS Error

    Why not use a formula to determine the month.

    Then you could count on the month (instead of the begin and end data).

    Or did i misread something?
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Registered User
    Join Date
    07-12-2013
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: COUNTIFS Error

    "Why not use a formula to determine the month."

    I don't know how to do that.

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: COUNTIFS Error

    K1 = month(I1) and drag down.

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNTIFS Error

    You'll have to break it down into parts to see which part isn't working...

    Do each of these return results you would expect them to ? Which one(s) doesn't ?
    =COUNTIFS(Data!$I:$I,">"&B38)
    =COUNTIFS(Data!$I:$I,"<"&C38+1)
    =COUNTIFS(Data!$D:$D,"?*")
    =COUNTIFS(Data!$B:$B,"")

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

    Re: COUNTIFS Error

    Maybe this...

    =COUNTIFS(Data!$I:$I,">"&B38, Data!$I:$I,"<"&C38+1,Data!$D:$D,"<>",Data!$B:$B,"")

    The wildcards ?* won't work on numeric data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: COUNTIFS Error

    tony same as post #2 which op says doesnt work

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: COUNTIFS Error

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

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

    Re: COUNTIFS Error

    They're slightly different.

    Data!$B:$B,"=")

    That will only count EMPTY cells.

    Data!$B:$B,"")

    That will count both cells that are empty and cells that contain formula blanks.

    Data!$D:$D points a column that has a number or is blank
    Data!$B:$B points to a name or is blank
    I think we need some clarification on what "blank" means. Does blank mean empty cells or cells that contain formula blanks?

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: COUNTIFS Error

    That's what I was thinking

  13. #13
    Registered User
    Join Date
    07-12-2013
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: COUNTIFS Error

    Quote Originally Posted by Jonmo1 View Post
    You'll have to break it down into parts to see which part isn't working...

    Do each of these return results you would expect them to ? Which one(s) doesn't ?
    =COUNTIFS(Data!$I:$I,">"&B38)
    =COUNTIFS(Data!$I:$I,"<"&C38+1)
    =COUNTIFS(Data!$D:$D,"?*")
    =COUNTIFS(Data!$B:$B,"")
    It's =COUNTIFS(Data!$D:$D,"?*") that isn't functioning.

  14. #14
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: COUNTIFS Error

    whats in col d?

  15. #15
    Registered User
    Join Date
    07-12-2013
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: COUNTIFS Error

    Quote Originally Posted by martindwilson View Post
    whats in col d?
    account numbers

  16. #16
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: COUNTIFS Error

    what does =COUNTIFS(Data!$D:$D,"<>") give

  17. #17
    Registered User
    Join Date
    07-12-2013
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: COUNTIFS Error

    Quote Originally Posted by Tony Valko View Post
    They're slightly different.

    Data!$B:$B,"=")

    That will only count EMPTY cells.

    Data!$B:$B,"")

    That will count both cells that are empty and cells that contain formula blanks.


    I think we need some clarification on what "blank" means. Does blank mean empty cells or cells that contain formula blanks?
    blank means empty

  18. #18
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: COUNTIFS Error

    ok here's one working
    Attached Files Attached Files

  19. #19
    Registered User
    Join Date
    07-12-2013
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: COUNTIFS Error

    Quote Originally Posted by whizbee View Post
    I am using the following formula:

    =COUNTIFS(Data!$I:$I,">"&B38, Data!$I:$I,"<"&C38+1,Data!$D:$D,"?*",Data!$B:$B,"")

    Data!$I:$I points to the contact date
    B38 points to the first of the month
    C38 points to the last of the month
    Data!$D:$D points a column that has a number or is blank
    Data!$B:$B points to a name or is blank

    My goal is to count the records with a contact date between first and last of the month, with column D not blank and column B blank. The formula is returning zero records, but there should be records.
    I ended up using this formula:
    =COUNTIFS(Data!$H:$H,">="&B2,Data!$I:$I,">="&B2,Data!$I:$I,"<"&C2+1,Data!$B:$B,"")

    Column D has account numbers, and column H has account creation dates, so it should be fine. But I still wasn't able to figure out how to count only records with a number in column D.

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

    Re: COUNTIFS Error

    As long as you have something that works...

    When you say column D contains numbers, do any start with leading zeros?

    See if this syntax works:

    Data!$D:$D,"<1E100"

    1E100 is scientific notation for the very large number 1 followed by 100 zeros. So, essentially, we're just asking the formula to test cells in column D for numbers less than a very very large number. Since the number criteria is so large there's a 100% chance that any numbers in the range will be less than 1E100 and should be counted.

+ 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. COUNTIFS Error
    By mgsc in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-25-2013, 10:01 AM
  2. Replies: 0
    Last Post: 12-16-2011, 09:01 AM
  3. Error using countifs
    By welchs101 in forum Excel General
    Replies: 6
    Last Post: 11-08-2011, 08:20 AM
  4. error trying to use vba countifs function
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-24-2011, 07:47 PM
  5. #Value error from a Countifs formula
    By Befuddled in forum Excel General
    Replies: 3
    Last Post: 01-04-2011, 02:03 PM

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