+ Reply to Thread
Results 1 to 10 of 10

IF statements help

Hybrid View

  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Swadlincote
    MS-Off Ver
    Excel 2010
    Posts
    6

    IF statements help

    What's wrong with this formula? and how many If statements can I put to one cell?

    =IF(D15=4*(AND(H15>2,H15<5)),"Recommended",""), IF(D15=4*(AND(H15>=5,H15<15),"Required","")
    Last edited by arlu1201; 11-05-2012 at 12:29 PM. Reason: OP edited subsequent post.

  2. #2
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: IF statements help

    There ya go...

    The problem is the comma before the second IF, change it to a &, and you're set
    commas are used to separate syntax within a given function, while an ampersand is used to string together two separate functions
    Going for Guru! Click the Star to the bottom left of this post if I helped!

  3. #3
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: IF statements help

    What are the conditions you are trying to put in?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  4. #4
    Registered User
    Join Date
    11-05-2012
    Location
    Swadlincote
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: IF statements help

    Risk Assessment Template.xls

    Thanks for the reply.

    See attachment. Basically I am trying to populate Cell I15 with text dependant on the value in Cell D15 and the Class range it falls in to.

    Gaz

  5. #5
    Registered User
    Join Date
    11-05-2012
    Location
    Swadlincote
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: IF statements help

    OK. I have that working. Thanks.

    Is there an umlimited amount of IF statements I can assign in this way? I have 11 to enter.

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,640

    Re: IF statements help

    Quote Originally Posted by isomagaz View Post
    OK. I have that working. Thanks.

    Is there an umlimited amount of IF statements I can assign in this way? I have 11 to enter.
    In that case using IF is probably not the best solution. Which are the conditions and their expected results?

  7. #7
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,640

    Re: IF statements help

    Perhaps
    =IF(D15=4,IF(AND(H15>2,H15<5),"Recommended",IF(AND(H15>=5,H15<15),"Required")),"")

  8. #8
    Registered User
    Join Date
    11-05-2012
    Location
    Swadlincote
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: IF statements help

    Pepe, see previous reply with the attachement.

  9. #9
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2504
    Posts
    13,640

    Re: IF statements help

    Quote Originally Posted by isomagaz View Post
    Pepe, see previous reply with the attachement.
    Could you please explain?

  10. #10
    Registered User
    Join Date
    11-05-2012
    Location
    Swadlincote
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: IF statements help

    Ive got this working how I want using If statements. Thanks for the advice about the '&'.

    =IF(D15=4*(AND(H15>2,H15<5)),"Recommended","")&IF(D15=4*(AND(H15>=5,H15<=15)),"Required","")&IF(D15=3*(AND(H15>=0,H15<5)),"None","")&IF(D15=3*(AND(H15>=5,H15<8)),"Recommended","")&IF(D15=3*(AND(H15>=8,H15<=15)),"Required","")&IF(D15=2*(AND(H15>=0,H15<8)),"None","")&IF(D15=2*(AND(H15>=8,H15<11)),"Recommended","")&IF(D15=2*(AND(H15>=11,H15<=15)),"Required","")&IF(D15=1*(AND(H15>=0,H15<11)),"None","")&IF(D15=1*(AND(H15>=11,H15<14)),"Recommended","")&IF(D15=1*(AND(H15>=14,H15<=15)),"Required","")

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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