Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: IF Function

  1. #1
    New Member
    Join Date
    Mar 2002
    Location
    Surfers Paradise
    Posts
    19
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Whats wrong withthe following formula,
    =IF(A32="Door Panel",IF(B32<0>1200,2,IF(B32<1200>1600,3,IF(B32<1600>2100,4,IF(B32>2100,5,0)))))
    What I'm trying to do is,the cell A32 has "Door Panel" in it and the sell B32 is less than 1200 insert 2 however if the sell B32 is greater than 1200 and less than 1600 then insert 3 and so on then if none of the criteria match insert 0.

  2. #2
    Board Regular RichardS's Avatar
    Join Date
    Feb 2002
    Location
    Victoria, Australia
    Posts
    761
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try
    =IF(A32="Door Panel",IF(B32<1200,2,IF(B32<1600,3,IF(B32<2100,4,IF(B32>=2100,5)))),0)
    HTH
    Richard

  3. #3
    MrExcel MVP
    Join Date
    Mar 2002
    Location
    Michigan USA
    Posts
    11,454
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-03-17 21:29, Lewy2 wrote:
    Whats wrong withthe following formula,
    =IF(A32="Door Panel",IF(B32<0>1200,2,IF(B32<1200>1600,3,IF(B32<1600>2100,4,IF(B32>2100,5,0)))))
    What I'm trying to do is,the cell A32 has "Door Panel" in it and the sell B32 is less than 1200 insert 2 however if the sell B32 is greater than 1200 and less than 1600 then insert 3 and so on then if none of the criteria match insert 0.
    Hi Lewy2:
    Your syntax needs correcting ... your formula should read as follows:

    =IF(A32="Door Panel",IF(B32<=1200,2,IF(AND(B32>1200,B32<=1600),3,IF(AND(B32>1600,B32<2100),4,IF(B32>=2100,5,0)))))

    I took the liberty of assuming that you mean if B32 is <=1200, and so on

    I hope this is what you want ... please post if it works for you, otherwise explain a little further what you are trying to accomplish!


    Regards!

    Yogi Anand, D.Eng, P.E.
    Energy Efficient Building Network LLC
    www.energyefficientbuild.com

  4. #4
    MrExcel MVP
    Join Date
    Mar 2002
    Location
    Michigan USA
    Posts
    11,454
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    My apologies ... Richard had alredy posted not only the right syntax, but he had also removed the unnecessary baggage of using 'and' statements, meaning he had also corrected the logic. Way to go Richard!

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
  •