Dynamic Named Range

Vanda_a

Well-known Member
Joined
Oct 29, 2012
Messages
934
Dear all

May i know if it is possible to create dynamic named range with multi columns?

Code:
=OFFSET($A$1,0,0,COUNT($A:$A),1)
Above formula is a dynamic named range which i get from microsoft.

I would like to a dynamic named range from A1:AN ......

Thank you very much
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
What kind of data do you have in each column?

I got A = No. B = product number. C and D = product detail. E = name of sale person or blank. F = selling rate. G = VAT. H = buy rate. I = VAT. J to AM are name of ppl I keep commission for. AN = profit/lost. J to AM sometime some are blank
 
Last edited:
Upvote 0
I got A = No. B = product number. C and D = product detail. E = name of sale person or blank. F = selling rate. G = VAT. H = buy rate. I = VAT. J to AM are name of ppl I keep commission for. AN = profit/lost. J to AM sometime some are blank

Column A is numeric, right?
 
Upvote 0

Activate Formulas | Name Manager.

Define Lrow as referring to:

=MATCH(9.99999999999999E+307,Sheet1!$A:$A)

Adjust the sheet name to suit. If you are on a non-American system, change decimal dot to comma; the list separator to semi-colon: that is:

=MATCH(9,99999999999999E+307;Sheet1!$A:$A)

Define DATA as referring to:

=Sheet1!$A$1:INDEX(Sheet1!$N:$N,Lrow)

Adjust the start cell, that is, Sheet1!$A$1, as needed.

If you would like to have PRODUCT separately next to DATA, then define it as referring to:

Either...

=INDEX(DATA,0,2)

Or...

=Sheet1!$B$1:INDEX(Sheet1!$B:$B,Lrow)

Follow the same logic for other parts as needed/required.
 
Upvote 0

It works perfectly. Thank you very much

And an other question please.
How the formula works if the column A is not numeric or it is text?
 
Upvote 0
It works perfectly. Thank you very much

Glad to help.

And an other question please.
How the formula works if the column A is not numeric or it is text?

When column A is text, you can change the definition of Lrow to:

=MATCH(REPT("z",255),Sheet1!$A:$A)

The idea is to pick out the most complete, preferably numeric, reference. Note that the MATCH expressions are faster than COUNTA and they don't miss any in-between empty cell while the latter does.
 
Upvote 0
Tested it. It works well. Thank you very much

You are welcome.

Is it possible if column A is number and text mix up? :D

Define LrowNum as referring to:

=MATCH(9.99999999999999E+307,Sheet1!$A:$A)

and LrowText as referring to:

=MATCH(REPT("z",255),Sheet1!$A:$A)

And, finally Lrow as referring to:

=LOOKUP(9.99999999999999E+307,CHOOSE({1,2,3},LrowTex,LrowNum,MAX(LrowNum,LrowText)))
 
Upvote 0

Forum statistics

Threads
1,214,583
Messages
6,120,378
Members
448,955
Latest member
BatCoder

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