Adapt SUMPRODUCT formula to ignore #N/A values in target range

jwalkerday

New Member
Joined
May 1, 2018
Messages
18
201920192019
Result FlagResult
1234545177
567814#N/A101
#N/A
=SUMPRODUCT(Sheet2!$B$3:$D$4*(Sheet2!$B$1:$D$1=B$1)*(Sheet2!$B$2:$D$2="Result")*(Sheet2!$A$3:$A$4=$A3))

<tbody>
</tbody>

I'm using the above SUMPRODUCT formula on a large dataset. In testing we found we occasionally get an #N/A in a few cells (never in the result column). This then causes the sum product formula to fail and return #N/A. We don't care about those #n/a values in the target range so I would like the sumproduct formula just to ignore them. Is there a way to do that in the formula by using something like ISNUMBER etc?

The other alternative I found online was to use VBA to remove all the n/a's after import from the database but this is not an option in this case.

NOTE- This post relates to https://www.mrexcel.com/forum/excel...heck-if-flagged-result-then-return-value.html but is a separate issue so I thought I would raise it in a separate post. However if you are looking for a SUMPRODUCT formula similar to this I would recommend checking out the other post.
 
Last edited:

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Why dont you just fix the formulas so the N/As don't appear?

IFERROR(formula, "")
 
Upvote 0
Control+shift+enter, not just enter:
Rich (BB code):
=SUM(IF(Sheet2!$B$1:$D$1=B$1,IF(Sheet2!$B$2:$D$2="Result",
     IF(ISNUMBER(Sheet2!$B$3:$D$4<strike></strike>),Sheet2!$B$3:$D$4<strike></strike>))))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,025
Messages
6,128,339
Members
449,443
Latest member
Chrissy_M

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
Back
Top