+ Reply to Thread
Results 1 to 5 of 5

Test if at least two colomns are equal in a range of columns.

  1. #1
    Registered User
    Join Date
    04-21-2014
    Location
    Cedar Falls
    MS-Off Ver
    Excel 2010
    Posts
    3

    Test if at least two colomns are equal in a range of columns.

    Hello everyone!

    I am working with several columns and would like to test if, among those columns, for each lines, at least two values are equal. It is easy to test that for two columns by having a simple test but I have no clue with several columns.

    For example, I want to test if among the columns "col1", "col2" and "col3", we do have at least twice the same value. In the first line, we have twice "a", second line, we have nothing, third line, we have twice "b" and fourth line, we have three times "a". How should I write the formula that corresponds to column "test"?

    col1 col2 col3 test
    a a b ok
    a b c x
    b c b ok
    a a a ok

    Thank you very much!!

  2. #2
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Test if at least two colomns are equal in a range of columns.

    =IF((COUNTIF(A1:C1,A1)+COUNTIF(A1:C1,B1)+COUNTIF(A1:C1,C1))>3,"dub","no dub")
    Try this
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  3. #3
    Registered User
    Join Date
    04-21-2014
    Location
    Cedar Falls
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Test if at least two colomns are equal in a range of columns.

    Hello popipipo!

    Wow thank you for you efficiency in replying! However, it doesn't work... It gives me those results:
    col1 col2 col3 test test2
    a a b ok no dub
    a b c x dub
    b c b ok no dub
    a a a ok dub

    And you can see that doesn't give the same result between "test" and "test2"...

    Thank you!!

  4. #4
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: Test if at least two colomns are equal in a range of columns.

    what is going wrong?
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    04-21-2014
    Location
    Cedar Falls
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Test if at least two colomns are equal in a range of columns.

    Awesome!! Thank you so so much!!! :D It's working! I just applied the formula with the first line where the names of the columns are. So, what exactly does it mean: "(COUNTIF(A4:C4,A4)+COUNTIF(A4:C4,B4)+COUNTIF(A4:C4,C4))>3" ?

    Thank you sosososo much!!!

+ 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] Test if a cell is within a name range and return a text value based on the test
    By DraconR in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 06-24-2013, 02:46 AM
  2. Replies: 3
    Last Post: 09-26-2012, 09:48 AM
  3. Pull data if columns equal a range
    By john0305 in forum Excel General
    Replies: 4
    Last Post: 01-17-2012, 11:18 AM
  4. Replies: 2
    Last Post: 04-21-2010, 07:25 AM
  5. ANOVA procedures and t-test equal variance
    By Noosa in forum Excel General
    Replies: 1
    Last Post: 05-12-2005, 02:09 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