Excel 2016 Dynamic Name Range to Include 2 columns

Hello,

I have a named range in Excel called DC01 and it contains 2 columns.  The columns could contain a 100 rows one week and 5 rows the next.  Because the size of the range changes each week I want to make the range dynamic.  I am using the following formula:

=OFFSET(DC01!$A$1,0,0,COUNTA(DC01!$A$1:$B$200),1)

This does not include the second column.

Could someone help me with this formula so both columns are dynamically named?

Thanks
Sonia BowditchInformation Security OfficerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Roy CoxGroup Finance ManagerCommented:
It would be simpler and more efficient to convert the data to a Table

Overview of Excel tables

There's lots of Dynamic Named Range examples and explanations here, but I would definitely try a Table
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
All you need is to specify the width argument in the Offset formula which is currently set to 1.

=OFFSET(DC01!$A$1,0,0,COUNTA(DC01!$A$1:$B$200),2)
0
NorieVBA ExpertCommented:
Try this.

='DC01'!$A$1:INDEX('DC01'!$B:$B, COUNTA('DC01'!$B:$B))
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Actually the fourth argument seems wrong, sorry I didn't pay attention to it.
Should be this...
=OFFSET(DC01!$A$1,0,0,COUNTA(DC01!$A:$A),2)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Rob HensonFinance AnalystCommented:
Will the number of values in the two columns be the same? If not you will need to determine the Max number of entries for the two columns.

=OFFSET(DC01!$A$1,0,0,MAX(COUNTA(DC01!$A:$A),COUNTA(DC01!$B:$B)),2)

Doing the count of A1:B200 as you were will only affect the height rather than the width of the dynamic range. If the columns do both have the same entries it will just double the height.
0
Rob HensonFinance AnalystCommented:
Then again, if the two columns are going to be different that raises another issue. If there are blanks within both columns but in different places, the count will produce the wrong value for the last row of data.

My suggestion above still won't give the correct result.
0
Sonia BowditchInformation Security OfficerAuthor Commented:
Thank you very much for your help.  All suggestions work perfectly.
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome Sonia!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.