Index match to replace dynamic named range

jcooooper

Board Regular
Joined
Mar 24, 2018
Messages
74
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I'm trying to replace a named range in my SUMPRODUCT calculation, in order to speed up my sheet.

I'm thinking it's some sort of combination of INDEX, MATCH and COUNTIF, but can't crack the code

If the below range is located in A1:B7, and I'm trying to return the in range in column A, if the text in column B is Equities, i.e A3:A6, what's the best way?


[TABLE="width: 258"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]GB9217[/TD]
[TD]Alternatives[/TD]
[/TR]
[TR]
[TD]LP8811[/TD]
[TD]Alternatives[/TD]
[/TR]
[TR]
[TD]FT_U0PX[/TD]
[TD]Equities[/TD]
[/TR]
[TR]
[TD]6005[/TD]
[TD]Equities[/TD]
[/TR]
[TR]
[TD]GB926[/TD]
[TD]Equities[/TD]
[/TR]
[TR]
[TD]36009[/TD]
[TD]Equities[/TD]
[/TR]
[TR]
[TD]134315[/TD]
[TD]Bonds
[/TD]
[/TR]
</tbody>[/TABLE]

Many thanks!
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Not sure if this has potential to speed things up for you or not....

If confirmed Ctrl + Shift + Enter then E1 will return the range values.
Otherwise, G1 will return the range address for use with INDIRECT function


Excel 2010
ABCDEFG
1GB9217AlternativesFT_U0PXA3:A7
2LP8811Alternatives
3FT_U0PXEquities
46005Equities
5GB926Equities
636009Equities
7134315Bonds
INFO
Cell Formulas
RangeFormula
G1="A" & MATCH("Equities",B1:B7,0) & ":A" & MATCH("Equities",B1:B7,0) + COUNTIF(B1:B7,"Equities")
E1{=INDEX(A1:A7,MATCH("Equities",B1:B7,0)):INDEX(A1:A7,MATCH("Equities",B1:B7,0)+COUNTIF(B1:B7,"Equities"))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
The sumproduct formula uses arrays as the array formulas. That makes the sheets slow.
If you are already having speed problems on your sheet, it may be best to change the formulas to macros.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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