+ Reply to Thread
Results 1 to 4 of 4

COUNTIF problem using a drop-down selection

  1. #1
    Forum Contributor
    Join Date
    02-05-2014
    Location
    Bay Area
    MS-Off Ver
    Excel 2010
    Posts
    164

    COUNTIF problem using a drop-down selection

    Good evening,

    I've been pulling my limited hair out trying to get a formula to work -- a formula that I thought would be easy. It's a COUNTIF formula that will not work for me. I attached a sample workbook with explanations about my formula goals, the actual formula that isn't working, and what the outcome should be (if the formula worked). There are three sheets in the workbook, with super-simple date.

    My primary challenge is the drop-down box. I included all of the US states in the list, plus an "All" option. The "All" option seems to be tripping me up, given my other criteria (which I label in the attached sample).

    I appreciate any help!
    Attached Files Attached Files

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: COUNTIF problem using a drop-down selection

    COUNTIFS() does not work with OR(), but you were pretty close. Try this....
    =IF($B$6="All",COUNTIFS(Data!F:F,">="&$B$3,Data!F:F,"<="&$B$4),COUNTIFS(Data!F:F,">="&$B$3,Data!F:F,"<="&$B$4,Data!J:J,B6))

    This will also work (and is shorter)...
    =COUNTIFS(Data!F:F,">="&$B$3,Data!F:F,"<="&$B$4,Data!J:J,IF(B6="All","<>",B6))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

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

    Thumbs up Re: COUNTIF problem using a drop-down selection

    Got the solution.. bro..

    Check the attachment...




    Don't forget, Click *
    Attached Files Attached Files

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: COUNTIF problem using a drop-down selection

    Happy to help and thanks for the feedback

+ 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. Excel COUNTIF with Drop-down Selection
    By DanielAd in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-17-2013, 03:07 PM
  2. Replies: 3
    Last Post: 07-31-2013, 11:53 AM
  3. Replies: 1
    Last Post: 06-03-2013, 06:30 AM
  4. Autolock Cells from a Drop Down List Selection and a Calendar Selection
    By John Anderson in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-04-2013, 10:54 AM
  5. Auto-update initial drop-down selection based on previous drop-downs
    By thornomad in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-16-2010, 09:55 AM

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