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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
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,215,212
Messages
6,123,654
Members
449,113
Latest member
Hochanz

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