+ Reply to Thread
Results 1 to 9 of 9

I need multiple criteria met in a sumproduct formula. Please help.

  1. #1
    Registered User
    Join Date
    10-01-2009
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2000
    Posts
    7

    I need multiple criteria met in a sumproduct formula. Please help.

    I've been banging my head against this for days now.

    I have 2 columns of data being populated by vlookups

    Column H is both numbers and text. Column I is Text and blanks. I need to be able to find only numeric values in column H greater than 0 and compare those occurrences with the corresponding cells in column I and if column I has a text entry (not a blank space) than to count that and at the end give me a total number of times these 2 criteria are met. As an example...

    If column H has a text entry then don't count it.
    If column H has a number less than zero then don't count it.
    If column H has a number greater than zero but column I is blank then don't count it.
    If column H has a number greater than 0 and column I has a text entry then count it.

    I've tried using many variations of a sumproduct formula and none of them work.

    This formula counts all instances where column I has a text entry without checking column H for a number greater than 0.

    =SUMPRODUCT(--(H2:H110>0),--(I2:I110<>" "))

    Or it's possible that the formula is counting the text entries in column H as a number greater than 0 but I'v tried excluding text using this..

    =SUMPRODUCT(--(H2:H110>0&<>"*"),--(I2:I110<>" "))

    but this causes an error in the formula somehow that I can't figure out. I even tried this

    =SUMPRODUCT(--(H2:H110>0&"*"),--(I2:I110<>" "))

    and I get a formula that counts only the times text appears in column H and column I together which is not what I want either.

    I'm self-taught on Excel so I know there's a lot I'm not understanding about creating formulas like this but I need to have this working by Friday and I just want it to work. If anyone could help me I'd really appreciate it.

    Thanks.
    Last edited by AwF2; 10-02-2009 at 03:50 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Help with SUMPRODUCT

    How about this:

    =SUMPRODUCT(--ISNUMBER($H$2:$H$110),--ISTEXT($I$2:$I$110))

    Or....

    =SUMPRODUCT(--ISNUMBER($H$2:$H$110),--($H$2:$H$110>0),--ISTEXT($I$2:$I$110))
    Last edited by JBeaucaire; 10-01-2009 at 05:33 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-01-2009
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2000
    Posts
    7

    Re: Help with SUMPRODUCT

    Your second formula is halfway there. It's counting all the instances of a number greater than 0 in column H but it's not making the comparison to column I.

    Something else that may be causing a problem is the blank space in column I is manufactured. What I mean is I have a vlookup in those cells that brings in data from another spreadsheet and if it find no data it inserts a blank. the vlookup runs like this.

    =IF(ISERROR(VLOOKUP(A2,'FILE PATH\[WORKBOOK.XLS]MONDAY'!$A$2:$D$3000,4,0)) ," ", (VLOOKUP(A2,'FILE PATH\[WORKBOOK.XLS]MONDAY'!$A$2:$D$3000,4,0)))

    The bolded red area is what gives me a blank in the cell as opposed to just leaving it with an error (#VALUE)

    I'll try massaging your formula to see if I can find a solution but the obvious choice (to me) didn't work.

    =SUMPRODUCT(--ISNUMBER($H$2:$H$110),--($H$2:$H$110>0),--ISTEXT($I$2:$I$110<>"*"))

    And thank you for helping me out.
    Last edited by AwF2; 10-01-2009 at 06:24 PM.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Help with SUMPRODUCT

    The second formula works for me as is.

    Please post a sample workbook with data showing it not working properly.

    Click GO ADVANCED and use the paperclip icon to post up your workbook.

  5. #5
    Registered User
    Join Date
    10-01-2009
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2000
    Posts
    7

    Re: Sumproduct

    I reduced the sample to a single day. the first sheet is where I'm trying to make this sumproduct formula work. the other three sheets are the source for the vlookups and such I'm using.
    Attached Files Attached Files

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Sumproduct

    Well, your use of " " in column I is throwing off the ISTEXT() test. Even changing to a null string "" wouldn't help. Let's just test the length of the text string that IS there....

    =SUMPRODUCT(--ISNUMBER($H$2:$H$110),--($H$2:$H$110>0),--(LEN($I$2:$I$110)>1))

  7. #7
    Registered User
    Join Date
    10-01-2009
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2000
    Posts
    7

    Re: Sumproduct

    That worked! Thank you so much. I've been wrestling with this since Tuesday and I just couldn't make the leap to get this to work. Very much appreciated

  8. #8
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Sumproduct

    AwF2, I'm glad you got a solution to your problem.

    In the future, please create threads with appropriate titles. Just "SUMPRODUCT" doesn't really describe your problem, it relates to the solution. Thanks!

  9. #9
    Registered User
    Join Date
    10-01-2009
    Location
    Austin, Texas
    MS-Off Ver
    Excel 2000
    Posts
    7

    Re: I need multiple criteria met in a sumproduct formula. Please help.

    Done and done.

+ 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