+ Reply to Thread
Results 1 to 4 of 4

Sumproduct formula that includes an or option

  1. #1
    Registered User
    Join Date
    01-09-2020
    Location
    Warwick, England
    MS-Off Ver
    2010
    Posts
    5

    Sumproduct formula that includes an or option

    Hi, I am trying to use a Sumproduct formula that looks in column B (B4:B64) for whatever is in cell D111 eg "Cardiology" then looks in column H (H4:H64) for EITHER the word "NA" or a number greater than zero. I tried the following:

    SUMPRODUCT(--($B$4:$B$64=$D111)*--(H$4:H$64="NA")+(H$4:H$64>0)) but it isnt calculating correctly.

    Can anyone help me? Thanks in advance

    PS I cant post the worksheet as this contains patient data but have screenshotted the relevant data.
    Annotation 2020-07-14 103943.jpg

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Sumproduct formula that includes an or option

    =SUMPRODUCT(($B$4:$B$64=$D111)*SIGN((H$4:H$64="NA")+(H$4:H$64>0)))

    that said, "NA" (string) is > 0 so, based on screenshot, I doubt you need the OR... i.e. solitary >0 test would suffice

    if the values in your table are either NA, 0 or >0 then you might find you could get away with COUNTIFS

    =COUNTIFS($B$4:$B$64,$D111,H$4:H$64,"<>0")

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,440

    Re: Sumproduct formula that includes an or option

    Please see the yellow banner and post a sample workbook.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    01-09-2020
    Location
    Warwick, England
    MS-Off Ver
    2010
    Posts
    5

    Re: Sumproduct formula that includes an or option

    Worked perfectly-thanks so much!! I hadnt picked up on the text being >0 either. Every day is a school day!!

+ 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: 11
    Last Post: 08-14-2019, 07:05 PM
  2. If formula that includes or
    By ellie2014 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-29-2015, 12:44 PM
  3. If then formula that includes counting
    By nclaus1018 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-20-2013, 03:21 PM
  4. Replies: 9
    Last Post: 11-07-2012, 03:13 AM
  5. [SOLVED] Counting Cells that includes exact match and also if a cell includes specific text
    By smclachlan in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-19-2012, 07:42 PM
  6. Sumproduct list that also includes errors and text
    By Mike_S in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 10-24-2009, 07:20 AM
  7. SUMPRODUCT function when source data includes text
    By Sean Anderson in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-09-2007, 09:10 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