+ Reply to Thread
Results 1 to 7 of 7

Nested If Statement with Multiple Logical Conditions

  1. #1
    Registered User
    Join Date
    03-18-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    Nested If Statement with Multiple Logical Conditions

    Can someone assist me with this? I believe the correct way of approaching this is an IFF statement with multiple Logical conditions.

    I want to compare column A vs B.

    IF A1 = M & B1 = F C1= Male to Female
    IF A2 = F & B2 = M C2= Female to Male
    IF A3 = M & B3 = 0 C3= Male to No Gender
    IF A4 = F & B4 = 0 C4= Female to No Gender


    Any assistance would be greatly appreciated.

    Thank you

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,578

    Re: Nested If Statement with Multiple Logical Conditions

    If I'm understanding correctly, in C1 copied down

    =IF(A1="","",IF(A1="F", "Female to ", "Male to ")& IF(B1 = 0, "No Gender", IF(B1="F", "Female", "Male")))
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Nested If Statement with Multiple Logical Conditions

    Maybe this

    =IF(AND(A1="",B1=""),"",IF(AND(A1="M",B1="F"),"Male to Female",IF(AND(A1="F",B1="M"),"Female to Male",IF(AND(A1="M",B1=0),"Male to No Gender",IF(AND(A1="F",B1=0),"Female to No Gender")))))

    A
    B
    C
    1
    M F Male to Female
    2
    F M Female to Male
    3
    M
    0
    Male to No Gender
    4
    F
    0
    Female to No Gender
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  4. #4
    Forum Contributor
    Join Date
    12-16-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    109

    Re: Nested If Statement with Multiple Logical Conditions

    =IF(AND(A1="M",B1="F"),"Male to Female",IF(AND(A1="F",B1="M"),"Female to Male",IF(AND(A1="M",B1=0),"Male to No Gender",IF(AND(A1="f",B1=0),"Female to No Gender"))))


    try this one

    http://www.easyexcelanswers.com

  5. #5
    Registered User
    Join Date
    03-18-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Nested If Statement with Multiple Logical Conditions

    Quote Originally Posted by ChemistB View Post
    If I'm understanding correctly, in C1 copied down

    =IF(A1="","",IF(A1="F", "Female to ", "Male to ")& IF(B1 = 0, "No Gender", IF(B1="F", "Female", "Male")))

    Thank you so much! It worked. To help understand the concept behind this function, can you elaborate a little bit more on the function? I am not sure what is "" mean and I am assuming you are concat each row? Thanks again for your help

  6. #6
    Registered User
    Join Date
    03-18-2014
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Nested If Statement with Multiple Logical Conditions

    Quote Originally Posted by AlKey View Post
    Maybe this

    =IF(AND(A1="",B1=""),"",IF(AND(A1="M",B1="F"),"Male to Female",IF(AND(A1="F",B1="M"),"Female to Male",IF(AND(A1="M",B1=0),"Male to No Gender",IF(AND(A1="F",B1=0),"Female to No Gender")))))

    A
    B
    C
    1
    M F Male to Female
    2
    F M Female to Male
    3
    M
    0
    Male to No Gender
    4
    F
    0
    Female to No Gender
    Thank you so much! It worked. To help understand the concept behind this function, can you elaborate a little bit more on the function? I am not sure what is "" mean and I am assuming you are concat each row? Thanks again for your help

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Nested If Statement with Multiple Logical Conditions

    Hi gatefire08

    "" is used for error trapping in case like if cell is empty to show nothing.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 4
    Last Post: 02-19-2014, 06:31 AM
  2. [SOLVED] Need Help with Multiple Condition Nested Logical Functions
    By SandPounder1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-17-2014, 07:29 PM
  3. [SOLVED] Nested IFS and multiple logical formulae
    By jdohlinger in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-29-2012, 01:41 PM
  4. Replies: 11
    Last Post: 10-26-2011, 03:24 PM
  5. Nested IF statement 3 conditions 3 outcomes
    By Nick_in_Dubai in forum Excel General
    Replies: 1
    Last Post: 03-12-2009, 04:38 AM

Tags for this Thread

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