Using cell text in formula - array

Formula11

Active Member
Joined
Mar 1, 2005
Messages
468
Office Version
  1. 365
Platform
  1. Windows
How can I use text in cell for formula with array.

For example in row 2, the formula includes an array.
In row 3 I want to use the contents of cell R3 to indicate the array. But this doesn't work. I tried INDIRECT.



1673317756310.png
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
From what I've seen, I don't think it's possible to use indirect function to put multiple criteria in the sumif function.

In fact, to get the first result and add the 3 values, the formula should be like this:
Excel Formula:
=SUM(SUMIF(B2:B8,{1;3;115},D2:D8))

I show you an option to put the criteria in another cell:
Dante Amor
ABCDEFGHIJK
1PartCDEFGH
21818
334181,3,115
452
5111
6439
7479
81156
D10
Cell Formulas
RangeFormula
J2J2=SUM(SUMIF(B2:B8,{1;3;115},D2:D8))
J3J3=SUM(IF(ISNUMBER(SEARCH(","&B2:B8&",",","&K3&",")),D2:D8))
Press CTRL+SHIFT+ENTER to enter array formulas.


NOTE XL2BB:
For the future, it would help greatly if you could give us the sample data in a form that we can copy to test with, rather that a picture.
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in
Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
---
 
Upvote 0
try
J3
=SUMIF(B:B,TEXTSPLIT(MID(R3,2,LEN(R3)-2),","),D:D)

:cool:
 
Upvote 0
Thanks to both for responses.
I was able to get DanteAmore's solution to work.

Is it possible to apply to 2 criteria as well.
This time, include the same array as above and another criteria for Case 1 in column A (this is a single value - not an array).
Sorry I can't load the addin as there are restrictions on my computer.


1673321593038.png
 
Upvote 0
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Thanks for that.
How about
Fluff.xlsm
ABCDEFGHIJK
1PartCDEFGH
21181
3234141,3,115
4152
51111
6219
71479
811156
Temp
Cell Formulas
RangeFormula
J3J3=SUM(SUMIFS(D:D,B:B,TEXTSPLIT(K3,","),A:A,K2))
 
Upvote 0
Thanks for looking at this.
I can see your method works above but for some reason I get a "0" result. Attempted twice including using the same figures and cells you had.
 
Upvote 0
I suspect your "numbers" are in-fact text & nor real numbers. If you convert them to numbers it should work.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
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