Spill operator error when using sumproduct

jazzista

Board Regular
Joined
Sep 15, 2014
Messages
86
Hello Forum.
I want to understand why when using the # spill operator wrapped inside sumproduct the formula returns an #N/A. I am attaching the spread with 2 formulas: One formula is using cell ranges with sumproduct (it works ) and the other one with the # operator and the N/A error( Highlighted in yellow)

Any help is greatly appreciate it . Thanks in advance

 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
That's becuase F3# refers to the spilled array F3:F8. It's not referring to the single cell F3. So the formula would be equivalent to the following...

=SUMPRODUCT(($B$2:$B$435=F3:F8)*1)

...which is not what you want. As a result, since the ranges are not the same size, it returns #N/A. You can, however, use the implicit operator...

G3, copied down:

=SUMPRODUCT(($B$2:$B$435=@$F$3#)*1)

You'll notice, though, the formula will return #VALUE! when it's not entered on a row that corresponds with a cell within the spilled array.
 
Upvote 0
@Domenic : I was just typing when i saw your post, so i had to halt :p :cool: 'cos this is your domain
The Spill operator is not the problem but the dimensions of the ranges being compared

Maybe he could also use a
Excel Formula:
COUNTIF( $B$2:$B$435 ,F3#)
 
Upvote 0
@Domenic : I was just typing when i saw your post, so i had to halt :p :cool: 'cos this is your domain
The Spill operator is not the problem but the dimensions of the ranges being compared

Maybe he could also use a
Excel Formula:
COUNTIF( $B$2:$B$435 ,F3#)

Oh yes, most definitely... Your formula will return a spilled array with the same results. :cool:

Cheers!
 
Upvote 0
Maybe he could also use a
Excel Formula:
COUNTIF( $B$2:$B$435 ,F3#)
.. and since that spills, there is in fact no need for any absolute addressing either (not that it will do any harm of course).

=COUNTIF(B2:B435,F3#)

Same thing for the original SORT(UNIQUE(.... formula
=SORT(UNIQUE(B2:B433))
 
Last edited:
Upvote 0
.. and given that the lengths of the spills will be unknown until they happen, perhaps place the sum differently and use this instead of having to manually adjust the SUM range.

spill array and sumproduct.xlsx
FG
1432
2SummaryTotals
3Injecting4
4Permanently Abandoned2
5Plugged and Abandoned1
6Producing317
7Shut In66
8Temporarily Abandoned42
9
Sheet1
Cell Formulas
RangeFormula
G1G1=SUM(G3#)
F3:F8F3=SORT(UNIQUE(B2:B433))
G3:G8G3=COUNTIF(B2:B435,F3#)
Dynamic array formulas.
 
Upvote 0
That's becuase F3# refers to the spilled array F3:F8. It's not referring to the single cell F3. So the formula would be equivalent to the following...

=SUMPRODUCT(($B$2:$B$435=F3:F8)*1)

...which is not what you want. As a result, since the ranges are not the same size, it returns #N/A. You can, however, use the implicit operator...

G3, copied down:

=SUMPRODUCT(($B$2:$B$435=@$F$3#)*1)

You'll notice, though, the formula will return #VALUE! when it's not entered on a row that corresponds with a cell within the spilled array.

Hi Domenic: Good morning. Thanks you very much for your solution and explanation about the N/A error. I made a small change in your formula you provided me which is : =SUMPRODUCT(($B$2:$B$435=@F$3#)*1) . I am just locking the row 3 instead of locking the whole cell , otherwise it would return N/A.
So in order to avoid the N/A, i should always use the "@" (implicit operator) with the spill operator "#". ? Again, thank you very much.
 

Attachments

  • 1599914348034.png
    1599914348034.png
    13.9 KB · Views: 7
Upvote 0
@Domenic : I was just typing when i saw your post, so i had to halt :p :cool: 'cos this is your domain
The Spill operator is not the problem but the dimensions of the ranges being compared

Maybe he could also use a
Excel Formula:
COUNTIF( $B$2:$B$435 ,F3#)


Hi Momentman: Thanks for your solution. I was trying to see why i would always get an error when using Sumproduct with any of the new excel formulas that would return spill results . Also, thanks for clarifying the dimension of the ranges being y problem ( completely forgot the ranges being return)
 
Upvote 0
.. and since that spills, there is in fact no need for any absolute addressing either (not that it will do any harm of course).

=COUNTIF(B2:B435,F3#)

Same thing for the original SORT(UNIQUE(.... formula
=SORT(UNIQUE(B2:B433))


HI Peter_SSs : Good morning. Thanks for your post to my question and elegant solution
 
Upvote 0

Forum statistics

Threads
1,214,626
Messages
6,120,602
Members
448,974
Latest member
ChristineC

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