1. #1
    Tackleberry
    Tackleberry's Avatar Become A Pro!
    Join Date: 12-01-10
    Posts: 441

    Alternative to nested IF functions in excel

    As I'm starting to do more and more with excel I need to find an alternative to using nested IF functions. Debugging nightmare and far from efficient I am sure.

    What other viable options are available to me?

    Thank you very much in advance.

  2. #2
    ejfel01
    ejfel01's Avatar Become A Pro!
    Join Date: 06-17-10
    Posts: 301
    Betpoints: 43

    Instead of using obscure nested "if" statements, one could always use the built-in "and" logical operator.
    It is used as =and(first_parameter; second_parameter, ...). "And" returns true, if all of its parameters are true.
    =if(and(p1;p2;case when true;case when false).
    Nomination(s):
    This post was nominated 1 time . To view the nominated thread please click here. People who nominated: mrtomk

  3. #3
    mrtomk
    mrtomk's Avatar Become A Pro!
    Join Date: 02-24-11
    Posts: 105
    Betpoints: 771

    Something like the above should work fine. Anything specific you are trying to achieve?

  4. #4
    Tackleberry
    Tackleberry's Avatar Become A Pro!
    Join Date: 12-01-10
    Posts: 441

    Quote Originally Posted by mrtomk View Post
    Something like the above should work fine. Anything specific you are trying to achieve?
    I will give a generic example of where using the IF function is become a pain for me right now.

    I will have a column full of the probabilities of a specific outcome occuring (ie points scored by a team). I then use the RAND function and then nested IF functions to determine the outcome for each trial.

  5. #5
    RickySteve
    SBR is a criminal organization
    RickySteve's Avatar Become A Pro!
    Join Date: 01-31-06
    Posts: 3,415
    Betpoints: 187

  6. #6
    Tackleberry
    Tackleberry's Avatar Become A Pro!
    Join Date: 12-01-10
    Posts: 441

    That looks like exactly what I need to continue to improve. Cheers RickySteve.

  7. #7
    mrtomk
    mrtomk's Avatar Become A Pro!
    Join Date: 02-24-11
    Posts: 105
    Betpoints: 771

    Wow, that books looks like the absolute ideal resource for this. Well done Ricky Steve. Sorry I cant be of more help, TackleBerry. I'm usually decent with ways to work around specific problems, but its tricky to define or put down in writing some better, general way of thinking about it, at least for me. Presumably the author of the above book does this well. If there is anything specific that is causing issue in the meantime, feel free to post and I'll have a crack. Best of luck with it...

  8. #8
    That Foreign Guy
    I got sunshine in a bag
    That Foreign Guy's Avatar Become A Pro!
    Join Date: 07-18-10
    Posts: 432
    Betpoints: 3069

    For the specific example you give it sounds like you could use a vlookup with range = true.

  9. #9
    Wrecktangle
    Wrecktangle's Avatar Become A Pro!
    Join Date: 03-01-09
    Posts: 1,524
    Betpoints: 3209

    Quote Originally Posted by That Foreign Guy View Post
    For the specific example you give it sounds like you could use a vlookup with range = true.
    I usually employ vlookup for problems like this.

  10. #10
    Tackleberry
    Tackleberry's Avatar Become A Pro!
    Join Date: 12-01-10
    Posts: 441

    vlookup looks ideal. Thanks guys.

Top