Results 1 to 6 of 6

How do I leave value unchanged

This is a discussion on How do I leave value unchanged within the Excel Questions forums, part of the Question Forums category; How would I have excel leave a value unchanged if it does not meet the parameters of the formula. Ex. ...

  1. #1
    New Member
    Join Date
    Jun 2003
    Posts
    2

    Default How do I leave value unchanged

    How would I have excel leave a value unchanged if it does not meet the parameters of the formula.


    Ex.

    =IF(B15 < C15,"6/11/03",IF(B15 > C15,"6/18/03",""))

    This formula would print 6/18/03 for all values in cell B15 that are greater than the value of
    C15.
    And it would also print 6/11/03 for any that was less than the value of C15

    My problem is that if the value in B15 is the same as the value in C15 the cell goes blank and I want it to keep the previous value (stay unchanged).

    Please let me know if there is a way to have the value stay the same if there is no change between B15 and C15.


    Thank you for any help you can give me.


  2. #2
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    24,062

    Default Re: How do I leave value unchanged

    Do you mean this?

    =IF(B15<=C15,"6/11/03","6/18/03")
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  3. #3
    New Member
    Join Date
    Jun 2003
    Posts
    2

    Default

    Quote Originally Posted by jmiskey
    Do you mean this?

    =IF(B15<=C15,"6/11/03","6/18/03")
    Thank you for the reply jminskey.

    What I am having issues with is that if the value in b15 and c15 are the same(No Change) excel changes the value to the second date "6/11/03" or makes it blank (depending on the formula used). I would like for the cell to keep its value ( Do nothing ) if b15 and c15 are =.

    I hope this clarifies the question.

  4. #4
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    24,062

    Default Re: How do I leave value unchanged

    If understand what you are asking, I afraid what you are asking is impossible without VBA.

    Excel has no memory of what was in cells before. If you have a value in a cell, then you enter a formula in that cell, the value that was there before ceases to be and is replaced by your formula.

    The only way to accomplish something like that is with VBA, where the calculations are done behind the scene and not in the cell itself.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  5. #5
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sunny, spring-like Hull
    Posts
    3,339

    Default Re: How do I leave value unchanged

    I'm not sure you can do that, a worksheet function always returns a value, which would overwrite what's in the cell. The only way I can think of would be via VBA and the worksheet change event, or possibly the RECALL function from MoreFunc, although I think you would need another column for this.

  6. #6
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,945

    Default Re: How do I leave value unchanged

    Actually, I think you can do this, without VBA...

    First, in Tools | Options, Calculate, CHECK the "Iterate" box, and put "1" in the number of iterations.

    Then, if your current formula is in D15, use this instead:

    =IF(B15 < C15,"6/11/03",IF(B15 > C15,"6/18/03",D15))

    this is when a circular reference comes handy...
    Regards,

    Juan Pablo González
    http://www.juanpg.com

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
  •  


DMCA.com