+ Reply to Thread
Results 1 to 12 of 12

SUMPRODUCT formula not working

  1. #1
    Registered User
    Join Date
    10-05-2009
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    76

    SUMPRODUCT formula not working

    Hi,
    I have been using the following formula successfully just by changing the names. For example I can change it from "Jennifer" to "Michael" to obtain my data successfully.

    =SUMPRODUCT(--('Paste Query Results Here'!$A:$A="Jennifer"),--('Paste Query Results Here'!$D:$D<>"NOT"),--('Paste Query Results Here'!$K:$K<>"K12"),--ISNUMBER(MATCH('Paste Query Results Here'!$D:$D,{"ADMIT","CANC","DENY","PEND","STU","WDRAW","CANCX","CANPX"},0)))

    However, I need to be able to change my formula to pull data for everyone else than my main 8 names. I tried this but it didn't work:

    =SUMPRODUCT(--('Paste Query Results Here'!$A:$A<>"Michael","Reggie","Jennifer","Hortencia","Matthew","Amanda","Alex","Virginia),--('Paste Query Results Here'!$D:$D<>"NOT"),--('Paste Query Results Here'!$K:$K<>"K12"),--ISNUMBER(MATCH('Paste Query Results Here'!$D:$D,{"ADMIT","CANC","DENY","PEND","STU","WDRAW","CANCX","CANPX"},0)))


    Please help! What am I doing wrong or missing? Your assistance would be greatly appreciated.
    Last edited by KINNEY0201; 09-29-2010 at 08:12 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SUMPRODUCT formula not working

    Try:

    Please Login or Register  to view this content.
    but be aware Sumproduct and full column references are a bad match (efficiency wise)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: SUMPRODUCT formula not working

    You can ape the existing MATCH approach but simply convert the outer test from ISNUMBER to ISNA

    Please Login or Register  to view this content.
    I'm pretty sure I've made the point previously but you should really be avoiding entire column references in SUMPRODUCT.

    In the above (we must assume XL2007+ else it would not work) you're referencing/processing over 4 million cells...

    Also (as previously mentioned I thin on other threads) the logic of your formula means the NOT test is superfluous given the subsequent MATCH test - removing it will save you a million cells
    (ie it must be something other than NOT if it has passed the ISNUMBER(MATCH test...)

  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: SUMPRODUCT formula not working

    Maybe:

    =SUMPRODUCT(--('Paste Query Results Here'!$A:$A<>{"Michael","Reggie","Jennifer","Hortencia","Matthew","Amanda","Alex","Virginia"}), --('Paste Query Results Here'!$D:$D<>"NOT"), --('Paste Query Results Here'!$K:$K<>"K12"), --ISNUMBER(MATCH('Paste Query Results Here'!$D:$D,{"ADMIT","CANC","DENY","PEND","STU","WDRAW","CANCX","CANPX"},0)))
    _________________
    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!)

  5. #5
    Registered User
    Join Date
    10-05-2009
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: SUMPRODUCT formula not working

    I understand your point and will adjust the amount of cells being searched.

    Below is the formula that is now working, however, what do I have to add to display a result of "0" INSTEAD of "#DIV/0!"?


    =SUMPRODUCT(--ISNA(MATCH('Paste Query Results Here'!$A:$A,{"Michael","Reggie","Jennifer","Hortencia","Matthew","Amanda","Alex","Virginia"},0)),--('Paste Query Results Here'!$D:$D<>"NOT"),--('Paste Query Results Here'!$K:$K<>"K12"),--ISNUMBER(MATCH('Paste Query Results Here'!$D:$D,{"ADMIT","CANC","DENY","PEND","STU","WDRAW","CANCX","CANPX"},0)))

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SUMPRODUCT formula not working

    What's causing the error? Do you have columns that have that error in them somewhere.

    The formula itself should not cause that error.

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: SUMPRODUCT formula not working

    You should only get #DIV/0! if any one of the cells referenced contains that specific underlying error. (Cols A,D,K)

    You can wrap the SUMPRODUCT within an IFERROR test but I suspect you need to investigate the #DIV/0! at source first.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SUMPRODUCT formula not working

    Maybe we should tag each other in from now on

  9. #9
    Registered User
    Join Date
    10-05-2009
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: SUMPRODUCT formula not working

    I'm sorry, I double checked the spreadsheet and it wasn't in the formula column.

    It was actually where I had entered =P11/O11 and P=0 and =0

    I feels like Monday all over!!

    I apologize again. But is there a simply answer for this?

    I just want it to return a value of 0 INSTEAD of #DIV/0

  10. #10
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: SUMPRODUCT formula not working

    Change

    =P11/O11

    to

    =IF(N(O11),P11/O11,0)

    or if you prefer

    =IFERROR(P11/O11,0)

    though note the latter is not backwards compatible (should that be a concern) and will also account for all error types - not just #DIV/0!

  11. #11
    Registered User
    Join Date
    10-05-2009
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: SUMPRODUCT formula not working

    That worked! Thanks so much!

    Could you explain the formula just so I understand?

    What does the N represent?

  12. #12
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: SUMPRODUCT formula not working

    Quote Originally Posted by MS Help

    The N function syntax has the following arguments (argument: A value that provides information to an action, an event, a method, a property, a function, or a procedure.):

    Value Required. The value you want converted.

    N converts values listed in the following table.

    A number - That number
    A date, in one of the built-in date formats available in Microsoft Excel - The serial number of that date
    TRUE - 1
    FALSE - 0
    An error value, such as #DIV/0! - The error value
    Anything else - 0
    In Excel 0 equates to FALSE, all other values are deemed TRUE - as such:

    Please Login or Register  to view this content.
    returns FALSE as

    Please Login or Register  to view this content.
    returns TRUE

    Please Login or Register  to view this content.
    in the above we take the value in O11 and est. numerical value of said value - if anything other than 0 the division is calculated else 0 is returned.

    I suggested N to account for possibility of O11 containing say a space, formula Null etc... could equally use SUM.

+ 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