+ Reply to Thread
Results 1 to 4 of 4

Double Letter reference error

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    CT, USA
    MS-Off Ver
    Excel 2013
    Posts
    43

    Double Letter reference error

    Hello!

    I have a formula--> =C70-((INDIRECT(CHAR(64+COLUMN(D$1))&MATCH("ITEM 1",$C:$C,0)))*36*$B70)-((INDIRECT(CHAR(64+COLUMN(D$1))&MATCH("ITEM 40",$C:$C,0)))*36*$B70)

    This works perfectly until I copy it over in the column AA, then I get a cell reference error...The formula in that field reads ---> =Z70-((INDIRECT(CHAR(64+COLUMN(AA$1))&MATCH("ITEM 1",$C:$C,0)))*36*$B70)-((INDIRECT(CHAR(64+COLUMN(AA$1))&MATCH("ITEM 40",$C:$C,0)))*36*$B70)

    Is there a way to fix this in my formula OR is it just something that excel cannot handle? This formula essential takes a sales forecast from a particular month in a long list of items, pulls the to item values out for that month and multiplies them by their inner counts and subtracts them from the previous months total.

    Thanks!

  2. #2
    Registered User
    Join Date
    01-25-2013
    Location
    CT, USA
    MS-Off Ver
    Excel 2013
    Posts
    43

    Re: Double Letter reference error

    Here is a general screen shot of what I am trying to accomplish, If it makes and sense to you
    excel help AA.png

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Double Letter reference error

    Hi,

    Your problem is that trying to indirectly reference column letters using CHAR() runs into the issue that CHAR(91) is NOT "AA" but "[".

    This sort of thing is often avoidable using INDEX and no indirection, though without seeing your sheet it's hard to offer a solution with that method. A similar alternative to your current formula, though without the above-mentioned limitation of CHAR, would be:

    =Z70-((INDIRECT(SUBSTITUTE(ADDRESS(1,COLUMN(AA$1),4),1,"")&MATCH("ITEM 1",$C:$C,0)))*36*$B70)-((INDIRECT(SUBSTITUTE(ADDRESS(1,COLUMN(AA$1),4),1,"")&MATCH("ITEM 40",$C:$C,0)))*36*$B70)

    though I have to stress that an INDEX-based solution, if possible, would be much preferable.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Double Letter reference error

    To understand why it fails when dragged to column AA
    We must first understand why it works for Column D

    CHAR(64+COLUMN(D$1))
    Column(D1) = 4
    CHAR(64+4)
    CHAR(68) = A

    Then indirect builds a cell reference with that letter + the result of the Match.

    As it's dragged right, Column(E1) = 5 Column(F1) = 6 etc...
    When it gets to AA = 27
    64+27 = 91
    CHAR(91) = [

    That doesn't make sense as a Column letter in a Cell reference, therfor a #REF! error results.


    To resolve, I would replace both instances these parts
    INDIRECT(CHAR(64+COLUMN(D$1))&MATCH("ITEM 1",$C:$C,0))
    INDIRECT(CHAR(64+COLUMN(D$1))&MATCH("ITEM 4",$C:$C,0))

    With
    INDEX(D:D,MATCH("ITEM 1",$C:$C,0))
    INDEX(D:D,MATCH("ITEM 4",$C:$C,0))

    Furthermore, If you're dragging this formula for 20+ columns,
    I would HIGHLY recommend you put the match functions in their own designated cells and refer to those in the formulas..

    Say $AY70 and $AZ70 for example

    So $AY70 = =MATCH("ITEM 1",$C:$C,0)
    So $AZ70 = =MATCH("ITEM 4",$C:$C,0)

    Then use this formula and drag right
    =C70-((INDEX(D:D,$AY70))*36*$B70)-((INDEX(D:D,$AZ70))*36*$B70)
    Last edited by Jonmo1; 10-11-2013 at 08:33 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Value with double reference...........
    By amitkr3855 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-21-2013, 05:26 AM
  2. [SOLVED] How To reference a drive by name instead of letter?
    By dougw03 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-16-2012, 03:14 PM
  3. Getting a column reference as a letter
    By Conor in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-01-2008, 12:29 PM
  4. Replies: 2
    Last Post: 04-10-2006, 07:55 PM
  5. Have A Letter Reference A Name For An Intoduction
    By travelersway in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 02-18-2005, 04:49 PM

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