+ Reply to Thread
Results 1 to 4 of 4

Asking SUMPRODUCT to not count empty cells

  1. #1
    Forum Contributor
    Join Date
    01-09-2009
    Location
    NJ/NY
    MS-Off Ver
    Excel 2007 & 2016
    Posts
    124

    Asking SUMPRODUCT to not count empty cells

    Hello - I have a spreadsheet that contains the following formulae:

    This formula counts how many Test 283 were pre-scheduled for Room01:
    SUMPRODUCT(('Room01'!$H$6:$H$5001="TEST 283 OP")*('Room01'!$O$6:$O$5001="pre-sched"))
    • Column H is a list of all of the procedures that could be performed in Room01. Test 283 is one of about 20.
    • Column O is a list of which tests were pre-scheduled or were same-day add-ons.

    This counts how many scheduled patients did not show up for any tests in Room01:
    COUNTIFS('Room01'!I6:I5001,"",'Room01'!N6:N5001,"Sch")
    • Column I is the time the patient arrived for testing; if this cell is blank, they did not show up for testing.
    • Column N is a list of either scheduled (Sch) or arrived. Everyone (both pre-scheduled and add-on) are scheduled for their tests, so everyone starts as Sch. When they sign in for testing, the time entry in Column I changes the cell in Column N to arrived. If they do not show up for testing, i.e., no time entry in Column I, this cell remains Sch.

    The problem is that if someone is scheduled for Test 283 and they do not show up, this is being counted by both formulae. The SUMPRODUCT formula works well for everything else I need to do; the only problem is I'm double-counting the scheduled tests and the no-shows, and I need for this formula to ignore the no-shows. Is there a way the SUMPRODUCT formula could be changed to ignore rows without an arrival time and count only those who showed up?

    Thank you.

  2. #2
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    484

    Re: Asking SUMPRODUCT to not count empty cells

    Try this:

    =SUMPRODUCT((Room01!$H$6:$H$5001="TEST 283 OP")*(Room01!$O$6:$O$5001="pre-sched")*(Room01!$I$6:$I$5001<>""))

    Or this:

    =COUNTIFS(Room01!$H$6:$H$5001,"TEST 283 OP",Room01!$O$6:$O$5001,"pre-sched",Room01!I6:I5001,"<>")

    In general, COUNTIFS works faster than SUMPRODUCT.

  3. #3
    Forum Contributor
    Join Date
    01-09-2009
    Location
    NJ/NY
    MS-Off Ver
    Excel 2007 & 2016
    Posts
    124

    Re: Asking SUMPRODUCT to not count empty cells

    Thanks very much Root. I used your suggestion for the SUMPRODUCT formula in place of my current ones, and it worked perfectly. I have another section where I use COUNTIF for different data, and I realized that I also need to exclude no-shows from these. I was able to modify your COUNTIF formula to the data being counted, and again, it worked perfectly.

    Thanks again.

  4. #4
    Valued Forum Contributor Root_'s Avatar
    Join Date
    07-29-2017
    Location
    _
    MS-Off Ver
    2010+
    Posts
    484

    Re: Asking SUMPRODUCT to not count empty cells

    You are most welcome.

+ 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] Formula to count cells that are not empty excluding cells with formulas
    By Imbizile in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-20-2015, 07:08 AM
  2. Replies: 10
    Last Post: 09-26-2015, 08:26 PM
  3. SUMPRODUCT including empty cells :(
    By dazbear in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-22-2014, 11:28 AM
  4. Adjust weighted average (sumproduct) for empty cells
    By robertgroen92 in forum Excel General
    Replies: 3
    Last Post: 03-19-2014, 08:13 AM
  5. SUMPRODUCT won't work when copying empty cells as values
    By FlossyGlamourous in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-28-2013, 02:34 PM
  6. Replies: 2
    Last Post: 07-25-2013, 01:01 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