+ Reply to Thread
Results 1 to 4 of 4

Avoiding Circular Reference

  1. #1
    Valued Forum Contributor ffffloyd's Avatar
    Join Date
    05-20-2008
    Location
    Perth, WA, Australia
    MS-Off Ver
    Office 365
    Posts
    249

    Avoiding Circular Reference

    Here's a tricky one.

    Let's say I have a sheet called Category. Column A contains code; column B contains description.

    Now I have another sheet in which either column F contains a category code or column G contains a category description. I want to look up the code in column F if the description is given or the description in column G if the code is given.

    I thought I might be able to do something like:

    in F2: IF($G2<>"",INDEX(Category!A:A,MATCH($G2,Category!$B:$B,0)),"")
    in G2: IF($F2<>"",INDEX(Category!B:B,MATCH($F2,Category!$A:$A,0)),"")

    (and then copy the formulae down the rest of the columns of course)

    In other words, if the cells were both empty then there would be no common dependency; it would just set them both to empty. However, if I provided either value then it would overwrite the formula in that cell so there would be only one formula left and nothing to be circular dependent about.

    However, it must be looking at the condition itself and seeing the two columns in common because it is coming up with a circular dependency. I thought I might be able to trick it by having IF(INDEX($G:$G,ROW())<>"",... but it still doesn't work.

    This sort of situation must crop up from time to time. How do we get around it?
    Last edited by ffffloyd; 06-29-2009 at 03:03 AM.

  2. #2
    Registered User
    Join Date
    05-06-2009
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: Avoiding Circular Reference

    I just tested this, and it seems to work:
    Go to Tools>Options>Calculation

    Click the "Irritations" Checkbox. It seems that this stops excel from re-calculating and finding the circular reference. When I did it, I got an N/A, so you would need to add an "IF(ISNA())" to your formula. 'Hope this helps a little.

  3. #3
    Valued Forum Contributor ffffloyd's Avatar
    Join Date
    05-20-2008
    Location
    Perth, WA, Australia
    MS-Off Ver
    Office 365
    Posts
    249

    Re: Avoiding Circular Reference

    "Irritations"

    Yes, I clicked the "Iterations" checkbox and, in fact, gave it a maximum of 1 thinking it might make it run quicker and, lo and behold, it works!

    Thanks Kelly.

  4. #4
    Registered User
    Join Date
    05-06-2009
    Location
    Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    85

    Re: Avoiding Circular Reference

    Ha! Freudian slip, maybe I was having a bad day. Well, glad it got you in the right direction!!

+ 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