+ Reply to Thread
Results 1 to 5 of 5

If Column C matches Column A or Column B return match or if no match, return 0

  1. #1
    Registered User
    Join Date
    05-28-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question If Column C matches Column A or Column B return match or if no match, return 0

    I'm working with some SNPs and like the title, I want to see if Column C matches Column A or Column B and if it does, return that match in Column D. If there is no match return 0 in Column D.


    I tried this and failed:

    =IF(COUNTIF(C1:C1,A1 or B1),A1 or B1,0)

    I also attempted:

    =IF(COUNTIF(C1:C1,OR(A1,B1)),OR(A1,B1),0)

    also failed
    Last edited by santaci; 05-28-2013 at 02:39 PM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,819

    Re: If Column C matches Column A or Column B return match or if no match, return 0

    You refer to columns A, B C and D in your description, but your example formulae refer to columns E, F and H.

    Pete
    Last edited by Pete_UK; 05-28-2013 at 02:41 PM.

  3. #3
    Registered User
    Join Date
    05-28-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: If Column C matches Column A or Column B return match or if no match, return 0

    I've edited the columns in the formulas.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,819

    Re: If Column C matches Column A or Column B return match or if no match, return 0

    Try this:

    =IF(OR(C1=A1,C1=B1),C1,0)

    Hope this helps.

    Pete

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: If Column C matches Column A or Column B return match or if no match, return 0

    Can you post a few rows worth of data and tell us what results you expect.

    A "few" = 5 to 10.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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