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:
Nice VBA Conclusion RR... :)
Thanks! It works in VBA because the argument to the Range object is a text string which is easily manipulated... unfortunately this does not seem translate over to the formula world (at least I haven't been able to crack it yet) because range references are not text strings there and when I tried to apply the INDIRECT function, it kept giving me a #REF! error, so I guess INDIRECT does not seem to like the multiple colon delimited ranges syntax.
 
Last edited:
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Not sure if when using
=CELL("address",MyRange)
in an English Excel-version you get a list separated by semi-colons or by commas

Assuming a list separated by semicolons like this
$B$4;$E$2:$E$15;$G$6:$G$10;$I$3:$I$20

Maybe this array formula (not elegant but seems it works)
=MIN(IFERROR(0+MID(TRIM(MID(SUBSTITUTE(";"&SUBSTITUTE(CELL("address",MyRange),":",";"),";",REPT(" ",100)),ROW(A1:A100)*100,100)),1+SEARCH("#",SUBSTITUTE(TRIM(MID(SUBSTITUTE(";"&SUBSTITUTE(CELL("address",MyRange),":",";"),";",REPT(" ",100)),ROW(A1:A100)*100,100)),"$","#",2)),100),""))
Ctrl+Shift+Enter

where MyRange is a named range --> $B$4:$B$7;$E$2:$E$15;$G$6:$G$10;$I$3:$I$20

M.
 
Last edited:
Upvote 0
Hi Marcelo,

Here I get: $B$4,$E$2:$E$15,$G$6:$G$10,$I$3:$I$20

Mark

Mark
Thank you

So, i hope this works for you

=MIN(IFERROR(0+MID(TRIM(MID(SUBSTITUTE(","&SUBSTITUTE(CELL("address",MyRange),":",","),",",REPT(" ",100)),ROW(A1:A100)*100,100)),1+SEARCH("#",SUBSTITUTE(TRIM(MID(SUBSTITUTE(","&SUBSTITUTE(CELL("address",MyRange),":",","),",",REPT(" ",100)),ROW(A1:A100)*100,100)),"$","#",2)),100),""))
Ctrl+Shift+Enter

M.
 
Upvote 0
You are most welcome Marcelo. I will try yours and report back in just a moment. Given all the input, while not VBA, maybe cheating a bit in using old style code in a Name:

MyRange refers to: =Sheet1!$B$4:$B$7,Sheet1!$E$2:$E$15,Sheet1!$G$6:$G$10,Sheet1!$I$3:$I$20
GetCell refers to: =GET.CELL(2,TEXTREF(SUBSTITUTE(SUBSTITUTE(CELL("address",MyRange),"$",""),",",":"),TRUE))

In any cell, formula: =GetCell

Changing the arguments for SUBSTITUTE as appropriate, does that work on your end?

Mark
 
Upvote 0
You are most welcome Marcelo. I will try yours and report back in just a moment. Given all the input, while not VBA, maybe cheating a bit in using old style code in a Name:

MyRange refers to: =Sheet1!$B$4:$B$7,Sheet1!$E$2:$E$15,Sheet1!$G$6:$G$10,Sheet1!$I$3:$I$20
GetCell refers to: =GET.CELL(2,TEXTREF(SUBSTITUTE(SUBSTITUTE(CELL("address",MyRange),"$",""),",",":"),TRUE))

In any cell, formula: =GetCell

Changing the arguments for SUBSTITUTE as appropriate, does that work on your end?

Mark

Mark,

Worked for me perfectly :)

M.
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,320
Members
449,218
Latest member
Excel Master

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