#N/A Error with SUMPRODUCT

geliseev

Board Regular
Joined
Feb 3, 2009
Messages
79
Hi,

I am trying to use the SUMPRODUCT formula in the following format:
SUMPRODUCT(--(....),--(....),()) to look up 2 conditions and sum the product of those.

I have 4 different tabs that are my raw data to look up against - on 3 of the tabs the formula works fine. On the fourth tab, it gives a #N/A error and I have no idea why. The data is pretty similar on all tabs, so I cannot possibly pinpoint why it would work on one and not the other.

Here's an example:
=SUMPRODUCT(
--('New Sales-YTD'!$AD$3:$AD$64000=$C159),
--('New Sales-YTD'!$G$3:$G$64000=$B159),
('New Sales-YTD'!$T$3:$T$64000))

it seems pretty straightforward:
- the range AD contains date information
- the range G contains market information
- the range T is the sales value

The only difference that I can see between the tabs where the formula works and the one that it does not work on is that the last tab has negative values in the T range? Other than that it is all the same stuff...

When I try to do a SUMIF or VLOOKUP I get no errors. The #NA error only shows up with SUMPRODUCT...

Any ideas ??

Thanks.
 

Some videos you may like

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

pagrender

Well-known Member
Joined
Sep 3, 2008
Messages
652
I've run into problems before with a SUMPRODUCT when I have errors in the data - as in, all the data that your formula looks at, if there's an error in there the SUMPRODUCT stopped working.

Do you have any errors in your data?
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,192
Try to the following...

=COUNTIF(Range,#N/A)

in order to see if there is #N/A somewhere?

Do you have any retrieval formulas (like one with VLOOKUP) in the relavant ranges?
 

geliseev

Board Regular
Joined
Feb 3, 2009
Messages
79

ADVERTISEMENT

Try to the following...

=COUNTIF(Range,#N/A)

in order to see if there is #N/A somewhere?

Do you have any retrieval formulas (like one with VLOOKUP) in the relavant ranges?
yes, it seems like there were some #N/A's in the data...thanks guys, got it sorted out :)
 

scottylad2

Well-known Member
Joined
Feb 2, 2009
Messages
1,919
If you look for posts by me from earlier this evening, jonmo gives a very good explanation of why sumproduct fails at the error and sumif overlooks it. Basically if sumif hits an error at either the criteria range or the range to sum, it replaces anything not fitting the criteria with a 0 whereas sumproduct throws a huff and says no way! I

i think thats what he said :LOL:
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,192
If you look for posts by me from earlier this evening, jonmo gives a very good explanation of why sumproduct fails at the error and sumif overlooks it. Basically if sumif hits an error at either the criteria range or the range to sum, it replaces anything not fitting the criteria with a 0 whereas sumproduct throws a huff and says no way! I

i think thats what he said :LOL:
SumIf won't ignore an error (#N/A, etc) if it's associated with the criterion.
By the way, the tolerance against errors is not displayed by just SumIf. Try to experiment with CountIf, Match, Vlookup, Hlookup, etc.
 

scottylad2

Well-known Member
Joined
Feb 2, 2009
Messages
1,919
It actually disturbs me, i use sumif countif regularly and never realised i might have errors and not be aware......:ROFLMAO: hopefully no one else has noticed! (making mental note to fix errors before boss spots)
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,994
Messages
5,514,679
Members
409,014
Latest member
evenyougreg

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top