+ Reply to Thread
Results 1 to 6 of 6

Can 'IF' condition be applied to the same Cell which already has value in it ?

  1. #1
    Registered User
    Join Date
    06-26-2017
    Location
    India
    MS-Off Ver
    2010
    Posts
    81

    Can 'IF' condition be applied to the same Cell which already has value in it ?

    Hi all,
    Hope everything is fine.

    Just for my explanation, I have attached a sample of the excel sheet. It has 'Before' & 'After' named sheets in it for better understanding.

    I have certain values (Not in formula format) in individual cells. Is there any method where I can apply "IF" condition to those cells wherein values which are already present in the cells shouldn't be disturbed.
    If there is a value of '0' or 'O' only then the value or the if condition has to be applied. For the rest, it should be as it is.

    Till now I was doing like:
    •I was adding a new column.
    •Apply 'if' condition in the newly inserted column.
    •Copy the obtained new values from the 'if' condition.
    •Paste it back to the required column.
    •Delete the column where I had appled 'if' condition.

    Is there any alternate solution wherein no new column has to be added separately ? Formula must be added in the same column itself.

    Example:
    •) If in column 'A' or 'B', there is value '0' and in column 'A'or 'B' if the value is 'Y', then the new value after applying "IF" condition can be either 'Y' or 'N'.

    •) If in column 'A' or 'B', there is value '0' and in column 'A' or 'B' if the value is 'N', then the new value after applying "IF" condition must be 'Y' only.

    •) If in both the column, the values are '0' or 'O', then the value can be 'Y' & 'Y' or 'N' & 'Y' or 'Y' & 'N'. But not 'N' & 'N'.

    In short,
    Combination of 'N' & 'N' in both column 'A' & column 'B' must not be there if there is '0' or 'O' in any one of those 2 columns.


    Thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,785

    Re: Can 'IF' condition be applied to the same Cell which already has value in it ?

    No, you cannot do this with a formula. You have two options: either use Find and Replace, or get a VBA solution (macro). You cannot have both a manually entered value and a formula in the same cell.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,885

    Re: Can 'IF' condition be applied to the same Cell which already has value in it ?

    Short answer is no. You can't do this with formula.

    Long answer - What you are trying to do will not be possible for few reasons.
    1. It creates circular reference with cell that contains formula.
    2. Whenever value is typed or manually inputted, formula will be overwritten with value.

    Don't be afraid to use helper column(s). There's nothing wrong with it and it will simplify subsequent formula considerably in many cases (and often creates less overhead).
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  4. #4
    Registered User
    Join Date
    06-26-2017
    Location
    India
    MS-Off Ver
    2010
    Posts
    81

    Re: Can 'IF' condition be applied to the same Cell which already has value in it ?

    Hi AliGW & CK76.
    Thank you for the suggestion.

  5. #5
    Registered User
    Join Date
    06-26-2017
    Location
    India
    MS-Off Ver
    2010
    Posts
    81

    Re: Can 'IF' condition be applied to the same Cell which already has value in it ?

    If you don't mind and if you are having some free time, can you give me a suggestion on the thread which I had posted yesterday ?
    The thread is located in the below mentioned link:

    https://www.excelforum.com/excel-gen...ent-value.html

    Thanks in advance.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,785

    Re: Can 'IF' condition be applied to the same Cell which already has value in it ?

    Thread moved to the VBA section.

    I can't help with the other thread, sorry.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Vlookup to a cell has to be applied using VBA
    By raju.r.083 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2017, 12:15 PM
  2. [SOLVED] CF only gets applied to a single cell (1 out of 4)
    By trstew in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2017, 11:58 AM
  3. 2 Percentage Calculation applied to one cell
    By Wiensy11 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-22-2015, 01:14 PM
  4. conditional format of one cell applied similarly to another cell?
    By ecojoy in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-29-2012, 10:57 AM
  5. [SOLVED] Formula in cell applied to data entered in that cell
    By JimDandy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-06-2012, 04:50 PM
  6. If statement with "left" condition applied to a date
    By Portuga in forum Excel General
    Replies: 3
    Last Post: 03-11-2008, 07:03 PM
  7. Replies: 2
    Last Post: 08-22-2007, 10:51 AM

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