+ Reply to Thread
Results 1 to 9 of 9

Comparing case sensitive values from 2 different columns

  1. #1
    Registered User
    Join Date
    08-08-2018
    Location
    New Zealand
    MS-Off Ver
    2013
    Posts
    3

    Comparing case sensitive values from 2 different columns

    Hi,

    I have two columns I want to compare and find out if the values in the first column match the values in the second column. It has to be case sensitive. I have tried using MATCH and VLOOKUP but these are not case sensitive. I have tried using EXACT but it does not work for what I am trying to achieve. Its a one to many relationship, with the 2nd column having the one, and the 1st column having the many. Column 1 has the value a,A,A,B, b,B ,a. Column 2 has A and B. I want to know in Column 1 when it has a matching exact value in column 2. The EXACT formula I am using is {=EXACT(A1,B$1:B$2)}. It does not seem to like the B$1 to B$2 part. Hopefully the attached image explains it better. Version = 2013

    Excel.PNG

    Thanks

    Jason

  2. #2
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Comparing case sensitive values from 2 different columns

    I don't understand the logic, when there are blanks in Column2.

  3. #3
    Registered User
    Join Date
    08-08-2018
    Location
    New Zealand
    MS-Off Ver
    2013
    Posts
    3

    Re: Comparing case sensitive values from 2 different columns

    Quote Originally Posted by kersplash View Post
    I don't understand the logic, when there are blanks in Column2.
    Column 2 is purely the values I am checking for. These are A and B. So I would like to know if the Values in Column 1 match any of the values in column 2. The return True or False

  4. #4
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Comparing case sensitive values from 2 different columns

    Hi,

    This should do what you want:

    Excel 2016 (Windows) 64 bit
    A
    B
    C
    1
    A A
    TRUE
    2
    a B
    FALSE
    3
    A
    TRUE
    4
    B
    TRUE
    5
    A
    TRUE
    6
    B
    TRUE
    7
    A
    TRUE
    Sheet: Sheet23

    Excel 2016 (Windows) 64 bit
    C
    1
    =ISNUMBER(LOOKUP(2,1/FIND(A1,B$1:B$2)))
    Sheet: Sheet23

    Formula copied down.

  5. #5
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Comparing case sensitive values from 2 different columns

    OK.

    First row....A=A=TRUE...got it
    Second row....a≠B=FALSE...got it
    Third row....A≠(blank)=TRUE...I don't got it.

  6. #6
    Forum Expert kersplash's Avatar
    Join Date
    11-22-2016
    Location
    Perth
    MS-Off Ver
    Home 2016 (Windows 10)/Work 2013 Pro Plus (Windows 10)
    Posts
    2,012

    Re: Comparing case sensitive values from 2 different columns

    OK, I understand now, ignore my attempt.

  7. #7
    Registered User
    Join Date
    08-08-2018
    Location
    New Zealand
    MS-Off Ver
    2013
    Posts
    3

    Re: Comparing case sensitive values from 2 different columns

    Quote Originally Posted by jtakw View Post
    Hi,

    This should do what you want:

    Excel 2016 (Windows) 64 bit
    A
    B
    C
    1
    A A
    TRUE
    2
    a B
    FALSE
    3
    A
    TRUE
    4
    B
    TRUE
    5
    A
    TRUE
    6
    B
    TRUE
    7
    A
    TRUE
    Sheet: Sheet23

    Excel 2016 (Windows) 64 bit
    C
    1
    =ISNUMBER(LOOKUP(2,1/FIND(A1,B$1:B$2)))
    Sheet: Sheet23

    Formula copied down.
    That is great and it work thanks. Just out of curiosity what does the / between the 1 and the FIND do?

  8. #8
    Forum Contributor
    Join Date
    10-30-2003
    Location
    Singapore
    MS-Off Ver
    Excel 2019
    Posts
    197

    Re: Comparing case sensitive values from 2 different columns

    Maybe,

    =EXACT(A1,$B$1)+EXACT(A1,$B$2)

    Or,

    =SUMPRODUCT(0+EXACT(A1,B$1:B$2))

    Regards
    Bosco
    Bosco

  9. #9
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Comparing case sensitive values from 2 different columns

    Quote Originally Posted by JasonBennett View Post
    That is great and it work thanks. Just out of curiosity what does the / between the 1 and the FIND do?
    Actually, in this particular situation, we don't "need" the 1/ before FIND since we're dealing with Single characters in Both Columns.
    However, in cases where the FIND may result in a number Greater than 1, 1/ (one divide) the result of the FIND ensures that the number Stays at 1 or below, and the LOOKUP is looking for 2, which it won't find, and thus returns the last match if there is one. The ISNUMBER just turns the result into TRUE/FALSE as you requested.

    If you found my posts helpful, add rep would be appreciated, click the "Star" at the lower left corner of the posts you found helpful, thank you.

+ 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: 1
    Last Post: 04-18-2018, 03:58 PM
  2. [SOLVED] Userform Textbox Looking at range not comparing case sensitive
    By jj33002 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2017, 01:38 PM
  3. [SOLVED] Assign values to case sensitive characters within string
    By tbsweet52 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-01-2015, 05:37 PM
  4. Unique Values that are case sensitive
    By VegasL in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-12-2013, 02:30 PM
  5. [SOLVED] SUMPRODUCT Or SUMIF - In case of Case sensitive???
    By lifeisaspreadsheet in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-28-2012, 07:57 AM
  6. Replies: 4
    Last Post: 06-19-2011, 03:07 AM
  7. Counting case-sensitive values withon a range of cells
    By Jessika in forum Excel General
    Replies: 2
    Last Post: 02-13-2007, 04:28 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