+ Reply to Thread
Results 1 to 5 of 5

Retaining the result of an IF function

  1. #1
    Registered User
    Join Date
    03-07-2008
    Posts
    3

    Retaining the result of an IF function

    I would be grateful for some help please.

    I use an IF function to write a "1" in the cell:

    =IF($C$15>$A20,IF($C$15<$A22,1,0),0)

    I wish to retain the "1" in the cell once the condition has reverted. I don't want it to go back to "0".

    Everything I have tried ends up as a circular reference.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Your formula could be changed to

    =IF(AND($C$15>$A20,$C$15<$A22),1,0)
    Re your problem. Maybe a small event macro would help. Note it assumes you change C15, A20 and A22 and they are not formulas.

    Right click sheet tab > select view code > paste in the below

    Please Login or Register  to view this content.
    if the cells are formulas try

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    03-07-2008
    Posts
    3
    Thank you for your help.

    So far I haven't managed to get any of the above working. I will spend some more time on it and report back later.

    Jaison

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try

    Please Login or Register  to view this content.
    VBA Noob

  5. #5
    Registered User
    Join Date
    03-07-2008
    Posts
    3
    Thank you, I am very grateful. This will really get me started.

    Now I have the foundations I should be able to progress further before needing any more help.

    Jaison

+ 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