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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
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,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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