Use a range in an array

psionman

New Member
Joined
Aug 15, 2023
Messages
4
I am trying to use a range as the items in an array

Using the Microsoft Office Sales data



In the cell j3 I have the formula

=SUM(SUMIFS($E:$E,$D:$D,"="&J2,$C:$C,{"Jones","Gill"}))

Can I write this so that it picks up the names from the cells j6:j7

e.g.

=SUM(SUMIFS($E:$E,$D:$D,"="&J2,$C:$C,{J6:J7}))

(needless to say this throws an error)

excel_arrays.png
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
What's stopping you from using:
Excel Formula:
=SUM(SUMIFS($E:$E,$D:$D,J2,$C:$C,J6:J7))
 
Upvote 0
Use SUMPRODUCT instead. Do not refer to whole column.
I use 1000 as farest range
Excel Formula:
=SUMPRODUCT(($D$2:$D$1000=J2)*(COUNTIF($J$6:$J$7,$C$2:$C$1000)>0)*$E$2:$E$1000)
 
Upvote 0
To that point, I suggest you update your profile information to include the version of office you are using as it can affect what will and won't work as a solution.
 
Upvote 0
To that point, I suggest you update your profile information to include the version of office you are using as it can affect what will and won't work as a solution.
I'm sorry I don't use MS products. My workbooks are LibreOffice Calc
 
Upvote 0
Given that this is an Excel forum. that would be useful information to know in your original posts then! Also, this is not the correct area for non-Excel questions, so I will move the thread.
 
Upvote 0

Forum statistics

Threads
1,215,312
Messages
6,124,197
Members
449,147
Latest member
sweetkt327

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