+ Reply to Thread
Results 1 to 9 of 9

if..then formula..circular reference error

  1. #1
    Registered User
    Join Date
    07-24-2009
    Location
    NY, NY
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    49

    if..then formula..circular reference error

    all,

    I am getting circular reference error while using this formula...please suggest if anyone has way to resolve it...

    thx in advance...

    A2 =IF(A1="buy",(B1+A2),A2)

    putting above formula in cell A2..

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: if..then formula..circular reference error

    yep !dont put it in a2 thats what a circular ref is you are refering to the cell the formula is in
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: if..then formula..circular reference error

    A circular reference is when you reference the cell with the formula within the formula itself. In your case, you're referencing cell A2 in a formula stored in A2. This can be useful if you're trying to use iterations to increase a cell's value, but usually it's not necessary.

    Can this function be stored in a different cell, say A3? If not, you would probably need to use a macro to update the value of A2 based on the value of A1 (in the Worksheet_Change event, perhaps).

  4. #4
    Registered User
    Join Date
    07-24-2009
    Location
    NY, NY
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    49

    Re: if..then formula..circular reference error

    Quote Originally Posted by martindwilson View Post
    yep !dont put it in a2 thats what a circular ref is you are refering to the cell the formula is in
    but i want to add current value in A2 + B1 if A1 is BUY else keep the same value in A2...any idea..how to go ahead...

  5. #5
    Registered User
    Join Date
    07-24-2009
    Location
    NY, NY
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    49

    Re: if..then formula..circular reference error

    Quote Originally Posted by Paul View Post
    A circular reference is when you reference the cell with the formula within the formula itself. In your case, you're referencing cell A2 in a formula stored in A2. This can be useful if you're trying to use iterations to increase a cell's value, but usually it's not necessary.

    Can this function be stored in a different cell, say A3? If not, you would probably need to use a macro to update the value of A2 based on the value of A1 (in the Worksheet_Change event, perhaps).

    I dont think so..we can store in A3 ...do i need to post this in excel programming section to get macro from someone? please suggest

  6. #6
    Forum Contributor
    Join Date
    05-29-2009
    Location
    Kalgoorlie Australia
    MS-Off Ver
    Excel 2007/10
    Posts
    251

    Re: if..then formula..circular reference error

    You could of typed into anyother cell =IF(A1="buy",(B1+A2),A2) leaving out the "A2" before the "if".
    Regards
    Peter

  7. #7
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: if..then formula..circular reference error

    No need for a new post, as the original intent was a worksheet function. The following code should be placed in the sheet module for the sheet on which you want it to run (right click on that sheet tab and choose View Code):
    Please Login or Register  to view this content.
    Hope that helps!

  8. #8
    Forum Contributor
    Join Date
    05-29-2009
    Location
    Kalgoorlie Australia
    MS-Off Ver
    Excel 2007/10
    Posts
    251

    Re: if..then formula..circular reference error

    Send a copy of the sheet if you like , remember no personal details.
    Regards
    Peter

  9. #9
    Registered User
    Join Date
    07-24-2009
    Location
    NY, NY
    MS-Off Ver
    Excel 2003 and 2007
    Posts
    49

    Re: if..then formula..circular reference error

    Quote Originally Posted by peterjuhnke View Post
    You could of typed into anyother cell =IF(A1="buy",(B1+A2),A2) leaving out the "A2" before the "if".
    Regards
    Peter
    Thanks it works..i will try tomorrow morning again and update you..

+ 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