+ Reply to Thread
Results 1 to 7 of 7

Multiple IF statements within one cell

  1. #1
    Registered User
    Join Date
    02-13-2014
    Location
    Somewhere, Rainbow
    MS-Off Ver
    Excel 2007
    Posts
    20

    Question Multiple IF statements within one cell

    All,

    I am using Excel 2007 and am attempting to write multiple IF statements within a cell. This multi-cell validation would be used to validate that A=B and C=D but A&B do not equal C&D as illustrated below:

    A B C D
    1 1 1 1 FALSE
    1 1 1 0 FALSE
    1 1 0 1 FALSE
    1 0 1 1 FALSE
    0 1 1 1 FALSE
    1 1 0 0 TRUE
    0 1 1 0 FALSE
    0 0 1 1 TRUE
    1 0 0 1 FALSE
    1 0 1 0 FALSE
    0 1 0 1 FALSE
    1 0 0 0 FALSE
    0 1 0 0 FALSE
    0 0 1 0 FALSE
    0 0 0 1 FALSE
    0 0 0 0 FALSE

    Here's the formula that I attempted to use:

    =IF(A2=B2, (IF(C2=D2), (IF(A2=C2), "Error3", "OK"), "Error2"), "Error1")

    However, I receive an error message stating "The formula you typed contains an error" and it highlights the D in the equation.

    I am not sure why the D was flagged as an error. If anything, I thought the "Error" portions would have been flagged...

    Is it possible to do a multi-cell validation in Excel?

    What was wrong with my formula?

    Any help would be appreciated. Thanks for reading!

    Respectfully,
    Talamon
    Last edited by Talamon; 02-13-2014 at 06:46 PM. Reason: I did not specify the cell locations in the original post.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Multiple IF statements within one cell

    For Row_2...try this:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  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,134

    Re: Multiple IF statements within one cell

    Row 2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and copy down

    Your formula does not have valid cell references.


    Regards, TMS
    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
    Registered User
    Join Date
    02-13-2014
    Location
    Somewhere, Rainbow
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Multiple IF statements within one cell

    Ron Coderre, that worked out well, thanks!

    Can I make it display something other than False/True?

  5. #5
    Registered User
    Join Date
    02-13-2014
    Location
    Somewhere, Rainbow
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Multiple IF statements within one cell

    TMShucks, my apologies, I did not include the cell location in my original post. I'll make the correction now.

    Thanks!

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Multiple IF statements within one cell

    Yes...use a structure like this:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-13-2014
    Location
    Somewhere, Rainbow
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Multiple IF statements within one cell

    All,

    Thank you very much! It works just the way I wanted it to!

    Respectfully,
    Talamon

+ 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. [SOLVED] Multiple If's and And statements in one cell?
    By Dagoom in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-11-2013, 05:14 AM
  2. Multiple IF THEN statements in one cell
    By faist001 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-13-2013, 03:06 PM
  3. [SOLVED] Excel 2007 : Multiple IF statements in one cell
    By StephenNesbit in forum Excel General
    Replies: 9
    Last Post: 06-06-2012, 04:52 PM
  4. Using Multiple If statements in a cell
    By Guygettinby in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2011, 08:06 PM
  5. [SOLVED] Multiple IF statements in one cell
    By Jones E in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2006, 02:55 PM

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