+ Reply to Thread
Results 1 to 4 of 4

Forcing a cell to change value

  1. #1
    Registered User
    Join Date
    10-20-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    58

    Forcing a cell to change value

    I have two free text cells A1,B1 each cell will contain any value from 0 up.

    Which ever cell is >0, cell C1 will use as the basis for a number of other calcualtions. But I do not want them both to be >0

    So, all I want to force either cell to =0 if the other cell >0

    i.e. A1=0 if B1>0 or if A1>0 then B1=0

    Can I put this code in C1 or does it need to reside somewhere else.

    Is this possible? and does his make sense?

    Thanks inadvance

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Forcing a cell to change value

    you might use: =IF(AND(A1>=B1,B1>=A1),"My Error Message",MAX(A1:B1))
    Last edited by Palmetto; 01-06-2010 at 01:08 PM.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    10-20-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    58

    Re: Forcing a cell to change value

    That works if I want to notify someone in C1 with the "error message" but is there a way that one cell will autmatically =0 if the other other is >0 and vise versa?
    Last edited by scottb; 01-06-2010 at 01:31 PM.

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Forcing a cell to change value

    The best solution is to prevent entry of a number if the other cell already has a value greater than zero. You can use Data validation, custom otion with a formula like so:

    For cell A1: =B1<1
    For cell B1: =A1<1

    Customize the error message as required when setting up the Data Validation.

    Note: the above formula do not prevent negative numbers.

+ 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