+ Reply to Thread
Results 1 to 3 of 3

Replace function with conditions

  1. #1
    Registered User
    Join Date
    07-24-2010
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2000,2003,2010
    Posts
    38

    Replace function with conditions

    Please see attached file.
    I have data in A,B,C, and D column.

    Based on following conditions i would like to fill column E with X, Y or Z

    IF (C1>-2 AND <2) AND (D1="") THAN E1 DISPLAY "Z"
    IF (D1= 0) AND (C1="") THAN E1 DISPLAY "Z"
    IF (A1>5) THAN E1 DISPLAY "Z"


    IF (D1< 0) AND (C1="") THAN E1 DISPLAY "X"
    IF (C1<-1) AND (D1="") THAN E1 DISPLAY "X"

    IF (D1> 0) AND (C1="") THAN E1 DISPLAY "Y"
    IF (C1>2) AND (D1="") THAN E1 DISPLAY "Y"

    Thanks for help
    Attached Files Attached Files
    Last edited by manharji; 02-24-2014 at 01:27 PM.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Replace function with conditions

    I think this will work for you in cell E1 =IF(AND(C1>-2,C1<2,D1=""),"Z",IF(AND(D1=0,C1=""),"Z",IF(A1>5,"Z",IF(AND(D1<0,C1=""),"X",IF(AND(C1<-1,D1=""),"X",IF(AND(D1>0,C1=""),"Y",IF(AND(C1>2,D1=""),"Y",""))))))) however, your profile says you have 2003 and that may not handle this many if then statements.

    EDIT: I think it will handle that many IF stmts, I think the # is 7 or 8 for .
    Last edited by Sam Capricci; 02-22-2014 at 07:09 AM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    02-17-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Replace function with conditions

    Hi manharji,

    Your result doesn't seem to be using the column B anywhere. Did you overlook it?

    The current problem can be solved by pasting the following formula in cell E1 and copying it down till required.

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    -Samanyu

    ~Taking over the world, one cell at a time!

+ 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. [SOLVED] Need help with REPLACE function to replace HEX A0 with HEX 20 in string
    By flyboy54 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-26-2013, 12:52 PM
  2. Replace names in one column under certain conditions
    By johnmerlino in forum Excel General
    Replies: 12
    Last Post: 11-20-2010, 03:53 PM
  3. Find and Replace with multiple conditions problem.
    By Benisato in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 03-12-2010, 06:06 AM
  4. Replies: 6
    Last Post: 02-04-2010, 10:27 PM
  5. Replace Function:Replace" and type in
    By ronnyc in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-19-2007, 06:26 PM

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