+ Reply to Thread
Results 1 to 9 of 9

auto change cell formula on condition of worksheet change in other cells

  1. #1
    Registered User
    Join Date
    05-31-2009
    Location
    Petaluma, CA, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    auto change cell formula on condition of worksheet change in other cells

    Hi Everyone,

    I would like a cell to use two formulas (one or other (not simultaneous)),
    one primary, and one secondary (if/only when conditions apply).
    Can it be done?

    ASSUME:
    in Worksheet one: C1=A1+B1

    in Worksheet two:
    A1='Worksheet one'!A1
    B1='Worksheet one'!B1
    C1='Worksheet one'!C1

    ----------------------
    PROBLEM:
    in worksheet two,
    ONLY if I change a value for A1 or B1 (in worksheet two),
    I want C1 formula to be =A1+B1 (in worksheet two)
    otherwise I want it to be ='Worksheet one'!C1

    Can I have the formulas tiered?
    Can the formula for C1 (worksheet two) change from:
    ='Worksheet one'!C1
    to:
    =A1+B1
    when and only if A1 or B1 (in worksheet two) change?
    Last edited by futurejock; 05-31-2009 at 01:55 PM. Reason: make more clear

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: auto change cell formula on condition of worksheet change in other cells

    futurejock,

    Welcome to the Excel Forum.

    PROBLEM:
    in worksheet two,
    ONLY if I change a value for A1 or B1 (in worksheet two),
    I want C1 formula to be =A1+B1 (in worksheet two)
    otherwise I want it to be ='Worksheet one'!C1
    Are you MANUALLY changing worksheet two, cell A1 and/or cell B1?
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: auto change cell formula on condition of worksheet change in other cells

    futurejock,


    If you are MANUALLY changing "Worksheet two" cell A1, or cell B1, Then see the attached workbook "Worksheet_Change Event - auto change cell formula on condition of worksheet change in other cel.xlsm" with the "Worksheet_Change" Event in "Worksheet two".

    In "Worksheet two", manually change either A1 or B1 and see the chnage to C1.

    If you delete the entries in either A1 or B1, then all the original formulae are returned.
    Last edited by stanleydgromjr; 05-31-2009 at 02:41 PM.

  4. #4
    Registered User
    Join Date
    05-31-2009
    Location
    Petaluma, CA, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: auto change cell formula on condition of worksheet change in other cells

    ThankS!!!

    Yes I am manually changing workbook two cells.

    Will try!

    Dan

  5. #5
    Registered User
    Join Date
    05-31-2009
    Location
    Petaluma, CA, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: auto change cell formula on condition of worksheet change in other cells

    Stanley's workbook did not work for me.

    Still interested in ideas/solutions...

    Thanks,

    Dan

  6. #6
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: auto change cell formula on condition of worksheet change in other cells

    Hmm, maybe in Sheet2!C1:

    =IF(AND(A1=Sheet1!A1,B1=Sheet1!B1),Sheet1!C1,A1+B1)


    Although, unless you can demonstrate differently, I think just putting =A1+B1 into that cell will result in always having the answer you want.

    ==========
    EDIT: As per forum rules, always include a link in this forum to other forums where you have posted the same question:
    http://www.mrexcel.com/forum/showthread.php?t=393480
    Last edited by JBeaucaire; 05-31-2009 at 06:28 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  7. #7
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: auto change cell formula on condition of worksheet change in other cells

    futurejock,

    Please post your workbook - scroll down and see "Manage Attachments".

    Or, per our "Private Messages", send you workbook to my e-mail address.

  8. #8
    Registered User
    Join Date
    05-31-2009
    Location
    Petaluma, CA, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: auto change cell formula on condition of worksheet change in other cells

    Hi All,

    Don't know if this has worked but the demonstration of solution is in the workbook I hope is attached to this message -- furnished by jbeaucaire.

    Thanks,

    Dan

  9. #9
    Administrator JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: auto change cell formula on condition of worksheet change in other cells

    Looks like it works to me. This is a non-macro solution, so you don't need the .xlsm file format.

    If that takes care of your need, be sure to EDIT your original post, click Go Advanced and mark the PREFIX box [SOLVED].



    (Also, use the "scales" icon in our posts to leave Feedback, it is appreciated)

+ 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