Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Jan 2001
    Location
    Wilmington, NC
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Make IF False Condition Return Blank or 0

    Hello,
    I'm trying to use the IF function in EX2K(9.0.2)to evaluate a numeric condition and return the results of a cell containing a text-field when True and insert a blank when False

    IF(A2<2,C2,"")

    works nicely, but when I try to evaluate for two conditions, (one textual, the other numeric) using embedded IF's,

    IF(E2 <> X,IF(D2 > 2,C2,""),IF(D2 > 3,C2,""))

    the False condition returns a numeric "0"
    Most annoying.
    I'd appreciate any help sorting this out.

    TIA,
    Mark

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Adelaide, South Australia, Australia
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Make IF False Condition Return Blank or 0

    If X is text you should use "X".

  3. #3
    Gold Lounger
    Join Date
    Feb 2001
    Location
    Dublin, Ireland, Republic of
    Posts
    2,697
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Make IF False Condition Return Blank or 0

    Assuming X is to be replaced by a value, I can see nothing that can cause a 0 to be returned. Having set up some tests, when the condition is false then the cell remains blank. Is there some other factor that might be coming into play ?

    Andrew

  4. #4
    Star Lounger
    Join Date
    Jan 2001
    Location
    Newcastle, New South Wales, Australia
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Make IF False Condition Return Blank or 0

    In both cases you're returning C2 or "". Is C2 equal to 0?
    ruth

  5. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Adelaide, South Australia, Australia
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Make IF False Condition Return Blank or 0

    I tried your formula using "X" and it worked perfectly. Ruth' point is very valid, I find when tracking down a glitch like this that if I put numbers like 666, 777 in vital places, the results stick out and cannot be confused with 0 and 1 which might be cell values or results returned by a function. This is very useful when developing nested IF

  6. #6
    Star Lounger
    Join Date
    Jan 2001
    Location
    Wilmington, NC
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Make IF False Condition Return Blank or 0

    Many thanks for the helpful tips. A beginner's error, putting the X in quotes did the trick. Good debugging suggestions too.
    Muchas Gracias to all.
    Mark

  7. #7
    Star Lounger
    Join Date
    Jan 2001
    Location
    Wilmington, NC
    Posts
    52
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Make IF False Condition Return Blank or 0

    Hi Ruth,
    Sorry, I should have explained more. In this case, C2 holds text. (This is a variation of the label discussion we're working on in the Word Forum) In this case "X" represents a label type that requires a more exacting criteria be met before it includes the text in C2.

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •