+ Reply to Thread
Results 1 to 4 of 4

multiple ranges in countif formula

  1. #1
    Forum Contributor
    Join Date
    08-29-2013
    Location
    CT
    MS-Off Ver
    Excel 2016 Mac
    Posts
    268

    multiple ranges in countif formula

    So here is my dilemma:

    I have a row of data one sheet and i want to count occurrences of the number "1" in all cells, but my problem is the range is not continuous.

    Here is the formula i have started =COUNTIF('Grade K-8'!B4:Q4,"1,68") but i want to also include the ranges of U4:AJ4, AN4:BC4, BG4:BV4, AND BZ4:CO4

    Any help would be greatly appreciated

    George

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

    Re: multiple ranges in countif formula

    If there will not be any cells that contain "1,68" between the ranges then just do this:

    =COUNTIF('Grade K-8'!B4:CO4,"1,68")

    Otherwise, you can do this:

    =COUNTIF('Grade K-8'!B4:Q4,"1,68")+COUNTIF('Grade K-8'!U4:AJ4,"1,68")+
    COUNTIF('Grade K-8'!AN4:BC4,"1,68")+COUNTIF('Grade K-8'!BG4:BV4,"1,68")+COUNTIF('Grade K-8'!BZ4:CO4,"1,68")
    Last edited by Tony Valko; 09-18-2013 at 01:34 PM.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Contributor
    Join Date
    08-29-2013
    Location
    CT
    MS-Off Ver
    Excel 2016 Mac
    Posts
    268

    Re: multiple ranges in countif formula

    Thanks,

    I was hoping to avoid that long of a furmula but i think there is no way around it

    George

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

    Re: multiple ranges in countif formula

    This one is a few keystrokes shorter but uses the volatile function INDIRECT:

    =SUM(COUNTIF(INDIRECT("'Grade K-8'!"&{"B4:Q4","U4:AJ4","AN4:BC4","BG4:BV4","BZ4:CO4"}),"1,68"))

+ 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] Something like COUNTIF but can take multiple ranges?
    By ablits1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-09-2013, 12:37 PM
  2. [SOLVED] trying to do a "countif" with multiple ranges and multiple criteria. Countif, Sumproduct?
    By completelyhis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-07-2013, 06:12 PM
  3. Replies: 7
    Last Post: 07-19-2012, 10:22 AM
  4. Formula COUNTIF Multiple Ranges with One Criteria
    By katcollins in forum Excel General
    Replies: 27
    Last Post: 01-11-2012, 04:21 PM
  5. Countif with multiple ranges
    By dr mint in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-20-2010, 02:14 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