Count rows referencing named range in cell

jcooooper

Board Regular
Joined
Mar 24, 2018
Messages
74
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I am trying to return the text strings in a named range.

When I use the named_range directly the formula, it works fine:

=TRANSPOSE(OFFSET(named_range,,,ROWS(named_range),1))

When I use a cell reference, it doesn't seem to work.

A1 = named_range

=TRANSPOSE(OFFSET(A1,,,ROWS(A1),1))

Any ideas?

Many thanks
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
If your named range is the value in a cell, then you need to use the INDIRECT function to tell Excel that the value is a range reference, i.e.
Excel Formula:
=TRANSPOSE(OFFSET(INDIRECT(A1),,,ROWS(INDIRECT(A1)),1))

You can Google the INDIRECT function for more details, explanations, and examples.
 
Upvote 0
As you have 365, you can also do it like
+Fluff 1.xlsm
AMNOPQRSTU
1Named_Range
2Name1Name1Name2Name3Name4Name5Name6Name7Name8
3Name2
4Name3
5Name4
6Name5
7Name6
8Name7
9Name8
10Name9
Main
Cell Formulas
RangeFormula
M2:T2M2=TRANSPOSE(SWITCH(A1,"Named_Range",Named_Range))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Named_Range=Main!$A$2:$A$9M2
 
Upvote 0
If your named range is the value in a cell, then you need to use the INDIRECT function to tell Excel that the value is a range reference, i.e.
Excel Formula:
=TRANSPOSE(OFFSET(INDIRECT(A1),,,ROWS(INDIRECT(A1)),1))

You can Google the INDIRECT function for more details, explanations, and examples.

Thanks Joe, I tried this but seem to be getting the #REF.

=TRANSPOSE(OFFSET(INDIRECT(A1),,,ROWS(INDIRECT(A1)),1))

A1 = named_range

when I go into evaluate formula, it seems to bug out at the first mention of A1. it's returning the named_range as "named_range" rather than named_range. I tried both TRUE and FALSE within DIRECT.

Any other ideas?
 
Upvote 0
As you have 365, you can also do it like
+Fluff 1.xlsm
AMNOPQRSTU
1Named_Range
2Name1Name1Name2Name3Name4Name5Name6Name7Name8
3Name2
4Name3
5Name4
6Name5
7Name6
8Name7
9Name8
10Name9
Main
Cell Formulas
RangeFormula
M2:T2M2=TRANSPOSE(SWITCH(A1,"Named_Range",Named_Range))
Dynamic array formulas.
Named Ranges
NameRefers ToCells
Named_Range=Main!$A$2:$A$9M2

Cheers fluff.

No luck with this one either. Would that formula work given the " "? The formula will always be returning a dynamic set of values (numbers or text), based on what the named_range is referencing
 
Upvote 0
Is the name of the named range in A1 & is it spelt exactly the same as the name of the range?
 
Upvote 0
Is the name of the named range in A1 & is it spelt exactly the same as the name of the range?
Thanks fluff.

How would this work if the value in cell A1 changes? As that will be a dropdown list of named ranges. is " " hard coded?

I'm also trying to only return/transpose the first column of named_range. But using the above returns the whole array. Sorry should have specified that.
 
Upvote 0
How many names do you have?
 
Upvote 0

Forum statistics

Threads
1,214,630
Messages
6,120,634
Members
448,973
Latest member
ChristineC

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