+ Reply to Thread
Results 1 to 6 of 6

Using LOOPS with IF to analyze specific cell ranges

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    157

    Re: Using LOOPS with IF to analyze specific cell ranges

    Quote Originally Posted by seaottr View Post
    I want to count the total of either "Completed" or "Not Completed - At Fault" (ignoring blanks and the other selections) within A3-A9
    =SUMPRODUCT(--(Sheet1!A3:A9="Completed")+--(Sheet1!A3:A9="Not Completed - At Fault"))
    Quote Originally Posted by seaottr View Post
    average of "Not Completed - At Fault"
    I don't know what you mean by this, you can only average numbers.
    If you mean count of "Not Completed - At Fault" then...
    =COUNTIF(Sheet1!A3:A9,"Not Completed - At Fault")

    I'm also not clear on how you got the 4/5 or 80%.

    Beau Nydal

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Using LOOPS with IF to analyze specific cell ranges

    Thanks so much! That's exactly what I needed!
    Glad to be of help.
    If you are satisfied with the solution, please mark your thread as solved by going to the top of YOUR first post and click on Thread Tools, then Go Advanced and choose the [solved] prefix.

    You may also leave feedback to the who helped with your solution. See my signature.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

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

    Re: Using LOOPS with IF to analyze specific cell ranges

    Quote Originally Posted by beaunydal View Post
    =SUMPRODUCT(--(Sheet1!A3:A9="Completed")+--(Sheet1!A3:A9="Not Completed - At Fault"))
    Beau Nydal, just an FYI but the double unary coercion in the above is not required given the addition taking place in the OR.

    The below will do the same but with fewer operations:

    =SUMPRODUCT((Sheet1!A3:A9="Completed")+(Sheet1!A3:A9="Not Completed - At Fault"))

    That said I think the COUNTIF approach is proabable the more logical given it's lightweight nature... if the terms being searched for are not variable you could use an inline array construct if preferred

    =SUM(COUNTIF(Sheet1!A3:A9,{"Completed","Not Completed - At Fault"}))

    Very much horses for courses - the above syntax is shorter (esp. when there are a number of terms) however it is not very flexible should you want to quickly adapt the terms themselves (ie via cell links etc)

+ 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