Define Range From Cell Value - in Array Formula

ipperz

New Member
Joined
Feb 1, 2018
Messages
12
Hello!

I am having trouble slimming down an array formula and am looking for suggestions. The below is part of a Index/Match array formula. What I want to do is make the Criteria portion of COUNTIF (the end range of 'Sheet2'!T$2:$T$250) based off the cell value in A1.

If A1 = 12, then it should be T$2:$T$12, instead of $250.


Code:
{=MATCH(0,COUNTIF($A3,'Sheet2'!T$2:$T$250),0)}

I've tried adding Indirect and Concatenate, as below, but it isn't working.

Code:
{=MATCH(0,COUNTIF($A$3,'Sheet2'!T$2:INDIRECT(CONCATENATE("T",A1))),0)}

Thank you for your insight!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi

The start and end of the range must be on the same worksheet.

Try your formula with:

=MATCH(0,COUNTIF($A$3,Sheet2!T$2:INDIRECT(CONCATENATE("'Sheet2'!T",A1))),0)

this should work, but it's better not to use Indirect(). You can use instead:

=MATCH(0,COUNTIF($A$3,Sheet2!T$2:INDEX(Sheet2!T:T,A1)),0)

Remark: you could also use just 1 function (also array entered):

=MATCH(FALSE,Sheet2!T$2:INDEX(Sheet2!T:T,A1)=A3,0)
 
Upvote 0

Forum statistics

Threads
1,214,386
Messages
6,119,220
Members
448,876
Latest member
Solitario

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