+ Reply to Thread
Results 1 to 4 of 4

Need a way to ignore empty cells in a sum/countif formula

  1. #1
    Registered User
    Join Date
    01-18-2014
    Location
    Wausau, WI, USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Need a way to ignore empty cells in a sum/countif formula

    After a lot of searching and trying I can't seem to get this right. I have a list of assessment scores for students with a matching grade in text form. I want to show the percentage of students that receive "Adv" and "Pro" grades out of the total number of students (cells with data). But I have extra cells in case students are added during the year. I need to have the formula ignore any empty cells and count all of the "Adv" + "Pro" grades divided by number of students with data. I would like to do this by including the extra cells in the formula so I don't need to amend the formula should students be added. This is the formula so far. Maybe there is a totally better way to write this formula. Thanks for any help in advance.

    =SUM(COUNTIF(C7:C60,"*"&{"Pro","Adv"}&"*"))/COUNTA(C7:C60)

    Bryan

  2. #2
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,676

    Re: Need a way to ignore empty cells in a sum/countif formula

    Doesn't that formula work? It seems OK to me unless you have cells with "formula blanks" in which case COUNTA will count those so perhaps switch to COUNTIF like this

    =SUM(COUNTIF(C7:C60,"*"&{"Pro","Adv"}&"*"))/COUNTIF(C7:C60,"?*")
    Audere est facere

  3. #3
    Registered User
    Join Date
    01-18-2014
    Location
    Wausau, WI, USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Need a way to ignore empty cells in a sum/countif formula

    That did it. Needed that COUNTIF statement instead. Thank you very much.

  4. #4
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,162

    Re: Need a way to ignore empty cells in a sum/countif formula

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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] Ignore empty cells in an IF formula
    By moppyau in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-09-2013, 06:42 AM
  2. Excel 2007 : Ignore empty cells? How?
    By PA0l0 in forum Excel General
    Replies: 3
    Last Post: 06-02-2011, 07:29 PM
  3. How to get a formula to ignore empty cells
    By scudder12 in forum Excel General
    Replies: 1
    Last Post: 10-02-2010, 06:18 PM
  4. Formula to use number in cell to left & ignore any empty cells
    By joya in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-13-2007, 12:52 PM
  5. [SOLVED] Can a formula ignore empty cells?
    By Melissa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-31-2006, 01:30 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