#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.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

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,210
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,210
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)
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,699
Messages
5,833,206
Members
430,196
Latest member
rez5656

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top