+ Reply to Thread
Results 1 to 5 of 5

Problem with nested if statement

  1. #1
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Cape Town
    MS-Off Ver
    Excel 2010
    Posts
    107

    Problem with nested if statement

    Hi, this is probably a simple question, here is my formula which is located in D2:

    =IF(C2={"Insured","Regular Driver","Insured is Regular"},{"Insured","Regular Driver","Insured is Regular"},"What is the relation of the driver to the Insured Party?")

    In C2 there is a drop down list which include the following : Insured, Regular Driver, Insured is Regular, None of the above

    What I Basically want to do is if C2 is "Insured" OR "Regular Driver" OR "Insured is Regular" Then return which one of the 3 it is otherwise return the statement "What is the relation of the driver to the Insured Party?"

    What is happening at the moment is that if on the drop down I select "Insured" the in D2 "Insured" is returned but for any of the other options the statement "What is the relation of the driver to the Insured Party?" is returned. I only want this to be returned if none of the above is selected from the drop down list.

    Thanks!!!
    Last edited by concatch; 03-06-2012 at 10:10 AM. Reason: changed neither to none of the above

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Problem with nested if statement

    =IF(or(C2={"Insured","Regular Driver","Insured is Regular"}),c2,"What is the relation of the driver to the Insured Party?")
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,385

    Re: Problem with nested if statement

    =IF(OR(C2="Insured",C2="Regular Driver",C2="Insured is Regular"),C2,"What is the relation of the driver to the Insured Party?")
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Cape Town
    MS-Off Ver
    Excel 2010
    Posts
    107

    Re: Problem with nested if statement

    Thank you both, just what I was looking for!!!

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,385

    Re: Problem with nested if statement

    You're welcome. Thanks for the rep.

+ 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