noncontiguous range, minimal row...

hurgadion

Active Member
Joined
Mar 19, 2010
Messages
426
Hi,
is it a simple Way to find a minimal row of a noncontiguous Range (number of Areas may be unknown... but we have function AREAS()) using a Formula ??

for (B4:B7,E2:E15,G6:G10,I3:I20) result is 2...

best regards,
hurgadion
 
Last edited:

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
hmm....minimal row? Why not this way below? (CSE formula)
=MIN(ROW(MyRange:MyRange))
Colon is a key
Interestingly, it appears to work for non-contiguous ranges only.... a single contiguous range seems to always return 1.
 
Upvote 0
hmm....minimal row? Why not this way below? (CSE formula)
=MIN(ROW(MyRange:MyRange))
Colon is a key
Interestingly, it appears to work for non-contiguous ranges only.... a single contiguous range seems to always return 1.
So it would seem the generalization of your method would be this...

=MIN(ROW(IF(AREAS(MyRange)=1,MyRange,MyRange:MyRange)))
 
Last edited:
Upvote 0
Interestingly, it appears to work for non-contiguous ranges only.... a single contiguous range seems to always return 1.
Never mind... your formula does work correctly for contiguous ranges... IF you array-enter it. Sorry for the misunderstanding on my part. Interestingly, your formula works fine normally-entered for non-contiguous ranges.



So it would seem the generalization of your method would be this...

=MIN(ROW(IF(AREAS(MyRange)=1,MyRange,MyRange:MyRange)))
I guess one would use the above only if they did not want an array-entered formula on the worksheet.
 
Upvote 0
Hi Rick

The formula, normally-entered, worked perfectly with contiguous or non-contiguous ranges. In what situation it didn't work for you?

M.
 
Upvote 0
Hi Rick

The formula, normally-entered, worked perfectly with contiguous or non-contiguous ranges. In what situation it didn't work for you?
I'll give you the exact procedure I followed...

1) Activate Sheet2
2) Select range R6:S8
3) Click in the Name Box and enter BOB
4) Select cell P8 (no significance to that cell, it was randomly picked)
5) Enter =MIN(ROW(BOB:BOB)) into the Formula Bar and hit the Enter Key

When I do the above, the number 1 is returned by the formula. When I check in the Name Manager, it shows BOB defined as...

=Sheet2!$R$6:$S$8

Now, annoyingly, even committing the formula with CTRL+SHIFT+ENTER does not change anything... the formula still shows 1 as the result. This is confusing because in all my other tests, doing that corrected the formula's output to the correct value, but now it did nothing.:confused:

Edit Note: Could the problem be BOB:BOB is a real range (a single full column) and the Defined Name is not being looked at?
 
Last edited:
Upvote 0
It seems that the name BOB is the problem. I performed exactly the same steps and named the range as Range3.
The formula =MIN(ROW(Range3:Range3)), normally entered, worked perfectly.

But doesn't work with BOB - weird!

M.
 
Upvote 0
Edit Note: Could the problem be BOB:BOB is a real range (a single full column) and the Defined Name is not being looked at?

Hi

That's what I think.

I tried forcing it to consider the named range, qualifying it. If it's a workbook name like =MIN(ROW(Book1!BOB:Book1!BOB)) or if it's a worksheet name like: =MIN(ROW(Sheet2!BOB:Sheet2!BOB)).

It worked for me this way.

Anyway, better not to define a name with a column name.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,553
Messages
6,125,483
Members
449,233
Latest member
Deardevil

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