+ Reply to Thread
Results 1 to 9 of 9

Comparing Data in a cell to data in multiple columns

  1. #1
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21

    Post Comparing Data in a cell to data in multiple columns

    Column A and B has multiple data in each Cell. I want to compare data input in column c to the Column A n Column B.
    Eg if data input in Cell C1 matches any Data in Column A or Column B.
    If Data input in C1 Matches any Data in Column A then check if D1 is greater than 2 if both are true then display "X" in E1
    If Data input in C1 Matches any Data in Column B then check if D1 is greater than 4 if both are true then display "X" in E1

    Please Login or Register  to view this content.
    codes i have tried
    Please Login or Register  to view this content.
    Last edited by Joym; 01-31-2017 at 04:38 PM.

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

    Re: Comparing Data in a cell to data in multiple columns

    Try

    =IF(AND(COUNTIF(A:B, C1) > 0, D1>2),"x","")
    Martin

  3. #3
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Comparing Data in a cell to data in multiple columns

    Or do you mean if either "z" or "x" (in C1) is found in A1:B1 or do you mean the whole string "zx"?

    Are we to understand that this is not case sensitive?
    Dave

  4. #4
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21

    Re: Comparing Data in a cell to data in multiple columns

    =IF(AND(COUNTIF(A:B, C1) > 0, D1>2),"x","") does work for the first portion -If Data input in C1 Matches any Data in Column A then check if D1 is greater than 2 if both are true then display "X" in E1
    however if i change value in C1 to xc and D1 to 3 the outcome should me null however it displays SLA Exceeded as it is equating D1>2

    Do i need compare column by column
    i tried the below equation but get error in value
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21
    Quote Originally Posted by mrice View Post
    Try

    =IF(AND(COUNTIF(A:B, C1) > 0, D1>2),"x","")
    =IF(AND(COUNTIF(A:B, C1) > 0, D1>2),"x","") does work for the first portion -If Data input in C1 Matches any Data in Column A then check if D1 is greater than 2 if both are true then display "X" in E1

    however if i change value in C1 to xc and D1 to 3 the outcome should me null however it displays SLA Exceeded as it is equating D1>2

    *

    Do i need compare column by column

    i tried the below equation but get error in value

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21
    Compare the string and not the individual characters
    Also it is not case sensitive

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,554

    Re: Comparing Data in a cell to data in multiple columns

    I am going to first address the questions asked in the first post. The following formula will display an 'X' in E1 when 'zx' is in C1 and a value greater than two is in D1. It will also display an 'X' in E1 when 'xc' is in C1 and a value greater than four is in D1. However as stated in post #4, it will not display an 'X' in E1 when 'xc' is in C1 and a value of three is in D1.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In posts #4 and #5 cell J2 and "SLA Exceeded" were introduced. If I understand them correctly the formula could be modified to read:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let us know if you have any questions.
    Last edited by JeteMc; 01-31-2017 at 11:25 PM.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  8. #8
    Registered User
    Join Date
    01-25-2017
    Location
    Fiji
    MS-Off Ver
    2013
    Posts
    21
    Quote Originally Posted by JeteMc View Post
    I am going to first address the questions asked in the first post. The following formula will display an 'X' in E1 when 'zx' is in C1 and a value greater than two is in D1. It will also display an 'X' in E1 when 'xc' is in C1 and a value greater than four is in D1. However as stated in post #4, it will not display an 'X' in E1 when 'xc' is in C1 and a value of three is in D1.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In posts #4 and #5 cell J2 and "SLA Exceeded" were introduced. If I understand them correctly the formula could be modified to read:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let us know if you have any questions.
    Thanks that was very helpful
    And sorry about the other 2 posts with the different inputs
    That was an error on my part

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,554

    Re: Comparing Data in a cell to data in multiple columns

    You're Welcome. Thank you for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Popup/Notification Box comparing cell data across multiple worksheets
    By amorshc in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-21-2016, 02:12 PM
  2. Comparing Multiple Sets of Data and Returning Appropriate Cell
    By boyko59 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-07-2016, 12:32 PM
  3. Comparing data in rows in multiple columns?
    By inso in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 08-25-2015, 11:31 AM
  4. Comparing Data on Multiple Sheets and Columns
    By ande2428 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-06-2014, 10:33 AM
  5. [SOLVED] Comparing data in columns over multiple sheets
    By BigBadBill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-14-2013, 02:01 PM
  6. Comparing data across multiple columns
    By jigabug in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-29-2010, 08:10 PM
  7. Comparing data in multiple columns
    By sammyd323 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-24-2007, 11:54 AM

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