Same formula, errors on a different row

shull82

New Member
Joined
Oct 16, 2023
Messages
8
Office Version
  1. 365
Platform
  1. Windows
Hi everyone,

I'm having an issue with one of my formulas.
The formula below works when referencing data in row 13.
But when I try to use the same formula for row 18 I have a #DIV/0! error

=+SUMPRODUCT(--(INDIRECT("'"&CD$5&"'!$E$3:$XDF$3")<=$C$3),INDIRECT("'"&CD$5&"'!$E$13:$XDF$13"))

=+SUMPRODUCT(--(INDIRECT("'"&CD$5&"'!$E$3:$XDF$3")<=$C$3),INDIRECT("'"&CD$5&"'!$E$18:$XDF$18"))

Thank you for any help!
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
What happens if you try:
Excel Formula:
=SUMPRODUCT((INDIRECT("'"&CD$5&"'!$E$3:$XDF$3")<=$C$3)*(INDIRECT("'"&CD$5&"'!$E$18:$XDF$18")))
 
Upvote 0
Now getting a #value! error for row 18.
I tested formula and row 13 and it worked just fine.
=SUMPRODUCT((INDIRECT("'"&CD$5&"'!$E$3:$XDF$3")<=$C$3)*(INDIRECT("'"&CD$5&"'!$E$13:$XDF$13")))
 
Upvote 0
What is found in $E$18:$XDF$18? Are there any errors appearing in that range? In this version, I'm anticipating that an error might be found in that range...and then handling it by replacing it with 0. Does this work?
Excel Formula:
=SUMPRODUCT((INDIRECT("'"&CD$5&"'!$E$3:$XDF$3")<=$C$3)*(IFERROR(INDIRECT("'"&CD$5&"'!$E$18:$XDF$18"),0)))
 
Upvote 0
To illustrate my point, I've mocked up a Sheet99 and referred to it within the INDIRECT formula. Sheet99 looks like this...showing only part of rows 3 and 18. Note that I've intentionally induced several error types for testing...and reordered the errors in several trials.
MrExcel_20231219.xlsx
EFGHIJKLMNO
32018161412108642
181234567#VALUE!#NUM!#DIV/0!#N/A
Sheet99
Cell Formulas
RangeFormula
E3:N3E3=SEQUENCE(,10,20,-2)
E18:K18E18=SEQUENCE(,7)
L18L18=XLOOKUP(19,E3:K3,E18:G18)
M18M18=LOG(-1)
N18N18=10/0
O18O18=XMATCH(19,E3,0)
Dynamic array formulas.

Then the formulas with and without error trapping are shown in CD7 and CD8:
MrExcel_20231219.xlsx
CCDCE
311threshold for logical condition
4
5Sheet99sheet reference
6
713with error trapping
8#VALUE!without error trapping
Sheet4
Cell Formulas
RangeFormula
CD7CD7=SUMPRODUCT((INDIRECT("'"&CD$5&"'!$E$3:$XDF$3")<=$C$3)*(IFERROR(INDIRECT("'"&CD$5&"'!$E$18:$XDF$18"),0)))
CD8CD8=SUMPRODUCT((INDIRECT("'"&CD$5&"'!$E$3:$XDF$3")<=$C$3)*(INDIRECT("'"&CD$5&"'!$E$18:$XDF$18")))

Whichever error type is encountered first appears to be the type of error returned by the formula.
 
Upvote 0

Forum statistics

Threads
1,215,102
Messages
6,123,097
Members
449,096
Latest member
provoking

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