+ Reply to Thread
Results 1 to 5 of 5

SUMPRODUCT/IF/COUNTIFS formula returning a #DIV/0 error

  1. #1
    Registered User
    Join Date
    11-28-2018
    Location
    Perth Australia
    MS-Off Ver
    2010
    Posts
    4

    Exclamation SUMPRODUCT/IF/COUNTIFS formula returning a #DIV/0 error

    Hi Excel grand wizards,

    I am currently creating a workbook to calculate data for the reporting of dental healthcare. I am using Excel 2010, it has to be 2010 because that is what is on my work PC.

    I have successfully created the following formula that takes the patient level data I receive from the service provider (don't worry I have put fake patient data in tab "PLD") and returns the number of individual patients that received services within a set time frame (see tab "MONTHLY" in the attached workbook in cell's D7, H7, N7, T7, Z7). one of tricks is that an individual patients details will appear multiple times for each incidence of care they receive.

    =SUMPRODUCT(IF((PLD!A2:A5004<=E9)*(PLD!A2:A5004>=C9),1/COUNTIFS(PLD!A2:A5004,"<="&E9,PLD!A2:A5004,">="&C9,PLD!B2:B5004,PLD!B2:B5004),0))

    This works very well and was created with the help of trawling this website (thanks).

    However on tabs "INDG" and "RURAL" I want to add one more criteria, so in the tab "INDIG" in cell D7 I have placed the following formula.

    =SUMPRODUCT(IF((PLD!$A$2:$A$5004<=E9)*(PLD!$A$2:$A$5004>=C9),1/COUNTIFS(PLD!K2:K5004,O2,PLD!A2:A5004,"<="&E9,PLD!A2:A5004,">="&C9,PLD!B2:B5004,PLD!B2:B5004),0))

    All I have added is the additional criteria "PLD!K2:K5004,O2" but now it returns the #DIV/0 error. I have spent a collective 7 hours trying to figure t out but I am at a loss.

    Thank you in advance for your help!
    Attached Files Attached Files

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,913

    Re: SUMPRODUCT/IF/COUNTIFS formula returning a #DIV/0 error

    try below array fromula
    Please Login or Register  to view this content.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: SUMPRODUCT/IF/COUNTIFS formula returning a #DIV/0 error

    Welcome to the forum!

    What result are you expecting in D7?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Registered User
    Join Date
    11-28-2018
    Location
    Perth Australia
    MS-Off Ver
    2010
    Posts
    4

    Re: SUMPRODUCT/IF/COUNTIFS formula returning a #DIV/0 error

    Thank you Samba!! That works perfectly! it is very much appreciated.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,410

    Re: SUMPRODUCT/IF/COUNTIFS formula returning a #DIV/0 error

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Replies: 2
    Last Post: 07-06-2015, 10:58 AM
  2. Sumproduct formula returning #Value! error
    By brizmol1 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-13-2014, 05:16 PM
  3. countifs returning value error
    By ammartino44 in forum Excel General
    Replies: 2
    Last Post: 10-03-2014, 06:22 PM
  4. SUMPRODUCT and COUNTIFS formula that is returning #DIV/0!
    By caseyjones05 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-19-2013, 03:37 PM
  5. [SOLVED] SUMPRODUCT formula returning #NUM! error message
    By inneedofhelp1 in forum Excel General
    Replies: 5
    Last Post: 11-06-2012, 10:04 AM
  6. [SOLVED] Sumproduct formula is returning #value error
    By ensmith in forum Excel General
    Replies: 2
    Last Post: 06-27-2012, 09:56 PM
  7. [SOLVED] SUMPRODUCT formula returning #VALUE! error
    By Valerie in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-28-2006, 09:40 AM

Tags for this Thread

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