+ Reply to Thread
Results 1 to 3 of 3

How do I compare 2 separate sets of cells of text, to see if each set of cells are equal

  1. #1
    Registered User
    Join Date
    09-06-2013
    Location
    Sudbury
    MS-Off Ver
    Excell 2010
    Posts
    1

    Question How do I compare 2 separate sets of cells of text, to see if each set of cells are equal

    I am trying to find a match for the City and when a difference occurs for the State. The formula that I was trying to use was =IF(AND(A1=A2,B1<>B2),"City Same","Different State") but there is an error in the formula and my knowledge with formulas is a bit limited


    City State Results
    Boston MA City Diff / State Same
    Brooklyn MA City Diff / State Diff
    Boston NY Citty Same / State Diff
    Boston MA City Same / State Same
    Boston MA City Diff / State Diff
    Brooklyn NY

  2. #2
    Registered User
    Join Date
    10-25-2012
    Location
    California, USA
    MS-Off Ver
    Excel 2007
    Posts
    71

    Re: How do I compare 2 separate sets of cells of text, to see if each set of cells are equ

    Try this instead; =IF(AND(A1=A2,B1<>B2),"City Same, Different State","")

    This will return "City Same, Different State" when comparing Boston NY and Boston MA. Otherwise you will see a blank.

  3. #3
    Forum Contributor
    Join Date
    12-22-2010
    Location
    Rio, Brazil
    MS-Off Ver
    Excel 2010, 2016
    Posts
    209

    Re: How do I compare 2 separate sets of cells of text, to see if each set of cells are equ

    Maybe

    Data Range
    A
    B
    C
    1
    City
    State
    Results
    2
    Boston
    MA
    City Diff / State Same
    3
    Brooklyn
    MA
    City Diff / State Diff
    4
    Boston
    NY
    City Same / State Diff
    5
    Boston
    MA
    City Same / State Same
    6
    Boston
    MA
    City Diff / State Diff
    7
    Brooklyn
    NY

    Formula in C2 copied down
    =IF(A2=A3,"City Same","City Diff")&" / "&IF(B2=B3,"State Same","State Diff")
    Marcelo Branco

+ 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: 2
    Last Post: 08-06-2013, 03:27 PM
  2. Formula needed for dividing 2 sets of cells and excluding adjacent text cells
    By excelteam777 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-07-2013, 06:45 PM
  3. Compare two cells, if equal move a third cells data to another cell
    By eriick in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-24-2013, 05:38 PM
  4. Compare 2 cells if equal then copy...
    By stimea in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-08-2012, 06:14 AM
  5. how to compare if multiple cells are equal
    By evanhughes in forum Excel General
    Replies: 13
    Last Post: 02-02-2010, 02:30 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