+ Reply to Thread
Results 1 to 4 of 4

Iff Statements - Comparison

Hybrid View

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

    Iff Statements - Comparison

    A l B l C
    Michael l Michel l
    James R l James l
    Karl l Karl B l
    John W l John W l
    Above, everything is merged in. The "l" is supposed to divide each column.


    The problem:


    I want an iff statement in which will compare data from column A vs column B.

    Michael vs Michel - (Mispelled) - Statement: "Mismatch on Name (Michael) vs (Michel)"
    James R vs James - (Mismatch) - Statement: "Mismatch: Column A has a suffix"
    Karl vs Karl B - (Mismatch) - Statement: "Mismatch: Column B has a suffix"
    John W vs John W (Extra spaces) - "Mismatch on Name: Extra Spaces"

    For the extra spaces, someone was able to help me with this IFF statement

    "IF(AND(TRIM(A1)=TRIM(B1),A1<>B1),"Mismatch on Name: Extra Space","")"

    Thank you for your help!

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Iff Statements - Comparison

    Try

    =IF(AND(FIND(B2,A2),LEN(A2)>LEN(B2)),"Mismatch: Column A has a suffix","")

    for one of them.
    Martin

  3. #3
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Iff Statements - Comparison

    instead of "" try

    Formula: copy to clipboard
    if(lenA1>lenb1,"Mismatch: Column A has a suffix",if(lenb1>a1,"Mismatch: Column B has a suffix",if(a1<>b1,"Mismatch on Name ("&A1&") vs ("&b1&")","these are the same")))

  4. #4
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: Iff Statements - Comparison

    good call mrice... misspellings would often trigger my "suffix" error...

    add the and(find()) piece to both of my first two if statements...

+ 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. Reading If statements and formulating values from if statements
    By crnam in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-16-2013, 05:20 AM
  2. Two IF statements with date comparison in Table
    By ExcelWarrior in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-29-2012, 04:25 PM
  3. Replies: 12
    Last Post: 05-15-2009, 08:38 AM
  4. Replies: 2
    Last Post: 10-07-2006, 09:23 AM
  5. [SOLVED] operator statements, shorting when reusing one of the statements?
    By KR in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-04-2005, 02:05 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