Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: IF equation

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    107
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    Why does the following equation always return "wrong":
    =IF(0.8>D2<1,D2*10,IF(D2>1,D2*100,IF(D2<0.8,D2*1000,"wrong")))
    when cell D2 contains the figure 0.9?
    Many thanks for your help.
    Macker

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    =ActiveCell.Address
    Posts
    478
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I think it's the way you're expressing the first part of the formula that is causing you the problem.

    Instead of 0.8>D2<1, replace it with the following...

    AND(D2>0.8,D2<1)

    (Assuming you mean that D2 should be in between 0.8 and 1)

    Rgds
    AJ

  3. #3
    MrExcel MVP Aladin Akyurek's Avatar
    Join Date
    Feb 2002
    Location
    The Hague, NL
    Posts
    84,021
    Post Thanks / Like
    Mentioned
    37 Post(s)
    Tagged
    7 Thread(s)

    Default

    On 2002-04-02 07:52, Macker72 wrote:
    Hi
    Why does the following equation always return "wrong":
    =IF(0.8>D2<1,D2*10,IF(D2>1,D2*100,IF(D2<0.8,D2*1000,"wrong")))
    when cell D2 contains the figure 0.9?
    Many thanks for your help.
    Macker
    The condition of the first IF needs rewriting:

    =IF(AND(D2>=0.8,D2<=1),D2*10,IF(D2>1,D2*100,IF(D2<0.8,D2*1000,"wrong")))





  4. #4
    Board Regular
    Join Date
    Mar 2002
    Posts
    107
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks AJ! you got it!

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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