+ Reply to Thread
Results 1 to 10 of 10

Problem with OFFSET function used in Named Ranges

  1. #1
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Problem with OFFSET function used in Named Ranges

    Dear Friends,

    I am facing a problem with OFFSET function. The following formula is entered to define a named range (CNTENGLISH).

    Please Login or Register  to view this content.
    And this defined name is used in formulas to do some calculations. Of course it is working nicely.

    But, when the few rows are deleted in the referred sheet, then the result in other sheets shows #NA error. Actually what happens with the named range is that it is not selecting the values properly.
    I don't understand why? & what is the problem?

    Any help? Thanks in advance.

    acishere.
    Last edited by VBA Noob; 11-12-2008 at 02:41 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Posting a sample workbook showing the problem might help us to figure it out.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: Problem with OFFSET function used in Named Ranges

    The function indeed works fine ON IT'S OWN. How is it used? Have you used the formula evaluation. This is a nice tool to figure these things out.
    I would expect a #REF or a #VALUE, but not a #NA. Is it a lookup function where the value itself is not found?
    Last edited by rwgrietveld; 11-12-2008 at 10:43 AM.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  4. #4
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    As you said, I am posting the sample workbook. In this many ranged names may not function properly becuase it refers to some other workbook.

    But, to explain the problem, I mentioned two ranged names CNTCSC, CNTSC and I have explained the problem in detail in the sample workbook.

    Please give me the solution.

    Thanks in advance.

    acsishere.
    Attached Files Attached Files

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I think it has to do with the resultant array sizes...

    Sumproduct must have same size ranges and each of those defined ranges yields a different size.

    You should refer to same column for all your Offset formulas

    If I change the CNTCLASS defined range to:

    =OFFSET('3TO5'!$O$4,0,0,COUNTA('3TO5'!$O:$O)-1,1)

    then I get results...

  6. #6
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Mr. NBVC,

    Thanks for your reply.

    I think I have also maintained the similarity with OFFSET functions when used to define named ranges.

    Again I have attached the workbook in which I have explained my views on the same.

    If we choose name manager window and see the CNTCLASS, then it chooses till the end of the row.

    But, CNTCSC, CNTSC names are choosing upto #300 and remaining rows are left. And, I think that may be the reason for #NA error.

    I seek your expertise in this regard.

    Thanks in advance, acsishere.
    Attached Files Attached Files

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    The COUNTA() parts in those formulas yield different results, since you have differing number of occupied cells.

    Therefore, this will yield different array sizes in the Sumproduct() formula and so will cause Errors.

    You should be consistent and refer to the same range in all the COUNTA() formulas so that the array size is consistent.

  8. #8
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Smile Dear Sir,

    Again, thanks for your continuous support.

    As I am a beginner, I really do not understand what you said. But, I knew that I am wrong somewhere.

    Sir, it is a request, can you please send me the explanations in my sample workbook?

    Please Sir.

    Thanks in advance,
    acsishere.

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    See attached.

    Have a look at how I redefined the 3 named ranges...

    Also, the results are not the same as you suggest because there only appears to be AB's in the same ranges as 3B.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    04-15-2008
    Location
    Tamil Nadu, India.
    MS-Off Ver
    Microsoft Office 2016
    Posts
    582

    Thumbs up Dear Mr. NBVC,

    Thanks a lot, lot, lot.

    This forum is very nice to learn also. Excellent!

    acsishere.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1