+ Reply to Thread
Results 1 to 5 of 5

Something like COUNTIF but can take multiple ranges?

Hybrid View

  1. #1
    Registered User
    Join Date
    05-24-2013
    Location
    usa
    MS-Off Ver
    Excel 2013
    Posts
    18

    Something like COUNTIF but can take multiple ranges?

    Hello,

    I want to use the function COUNTIF through a spreadsheet but it won't allow me to use it over more than one range. The only way I can get it to work is if I retype the whole function for each range. There are gaps and and headers in the spreadsheet in which I don't want to include the function and that is causing problems with the cells that I do want to use it for.

    Example of what works: =COUNTIF('Book1'!G4:G51, "Complete")
    Example of what I want but does not work =COUNTIF('Book1'!G4:G51,G53:G70, "Complete")

    Is there another function or would something like this require VBA code?

    Thanks and I can provide more detail if needed.
    Last edited by ablits1; 09-09-2013 at 09:42 AM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,695

    Re: Something like COUNTIF but can take multiple ranges?

    In your example what might be in G52? Would there be a header value (in A52?) that would allow the cells you don't want counted to be identified?
    Audere est facere

  3. #3
    Registered User
    Join Date
    05-24-2013
    Location
    usa
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: Something like COUNTIF but can take multiple ranges?

    The header value would be different in Column B where I am marking the tasks as R/C, R, O, or N/A. Column G would be the same through the spreadsheet.


    There is a column(B) that indicates if the piece in column G is required or not. In column B there could be an R/C, R, an O, or it could be N/A. I would only want to include R/C and R.


    In column G, there can be Not Started, In Progress, or Complete. I want to count if the item is marked Complete.

    There reason I want multiple ranges is because the tasks are listed and some are marked, for example, R for G1:G10, then R for G12:G15. G11 could be marked O.

    Could I just add an IF statement before the COUNTIF? Not sure how that would look..
    Last edited by ablits1; 09-09-2013 at 09:54 AM.

  4. #4
    Registered User
    Join Date
    05-24-2013
    Location
    usa
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: Something like COUNTIF but can take multiple ranges?

    Here is what I want on a much smaller scale. Please see the 2 tabs. I want to feed the Test tab into the Summary tab. I want to get the average of the Required pieces complete as well as the average of the optional pieces complete. This is an example of what I have been using "=COUNTIF('SEC +'!G4:G51, "In progress")/COUNTA('SEC +'!E4:E51)", but I realized it will not work on the example I am providing you because I would need multiple ranges which COUNTIF will not accept.

    SO is there a way I can add a simple IF statement to only include the R's and R/C's in the COUNTIF?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-24-2013
    Location
    usa
    MS-Off Ver
    Excel 2013
    Posts
    18

    Re: Something like COUNTIF but can take multiple ranges?

    I figured it out. I used the COUNTIFS function to check if it is Complete as well as contains R in the other columnn

+ 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] 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
  2. COUNTIF multiple criteria and ranges
    By larbac in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-14-2013, 07:34 AM
  3. Countif with multiple ranges
    By dr mint in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-20-2010, 02:14 AM
  4. countif and multiple named ranges
    By roland willems in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-14-2008, 10:59 AM
  5. [SOLVED] COUNTIF() With multiple ranges and variables
    By Thansal in forum Excel General
    Replies: 3
    Last Post: 07-12-2006, 12:35 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