+ Reply to Thread
Results 1 to 5 of 5

Giving a 'Y' or 'N' depending on data existing in another column

  1. #1
    Registered User
    Join Date
    05-21-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Giving a 'Y' or 'N' depending on data existing in another column

    Hi all,

    Hoping for a bit of help - got close to solving this one but can't seem to get over the line!

    I'm trying to take data from one column and stating 'Yes' if it exists in another, and 'No' if not. So for example:


    Column A has a list of numbers 1 - 400

    Column B has a list of 200 numbers, ranging between 1 - 400 (for example 1,2,4,6,7,9,11....)

    In Column C, I want a formula that states 'If the number in A1 also exists anywhere in Column B, then insert "Yes" into C1. If the number in A1 does not exist anywhere in Column B, then insert "No" into C1'.


    Thanks for having a look!

  2. #2
    Forum Expert RobertMika's Avatar
    Join Date
    06-22-2009
    Location
    Haverhill, UK
    MS-Off Ver
    Excel 2003-13
    Posts
    1,530

    Re: Giving a 'Y' or 'N' depending on data existing in another column

    The quickest
    =MATCH(A1,B:B,0)
    or as you requested:
    =IF(ISNUMBER(MATCH(A1,B:B,0)),"Y","N")
    drag down
    If you are http://www.excelforum.com/image.php?type=sigpic&userid=125481&dateline=1392355029happy with the results, please add to the contributor's
    reputation by clicking the reputation icon (star icon).




    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.
    To undo, select Thread Tools-> Mark thread as Unsolved.
    http://www.excelaris.co.uk

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Giving a 'Y' or 'N' depending on data existing in another column

    Try:

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Giving a 'Y' or 'N' depending on data existing in another column

    welcome to the forum. another alternative:
    =IF(COUNTIF(B:B,A1),"Y","N")

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  5. #5
    Registered User
    Join Date
    05-21-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Giving a 'Y' or 'N' depending on data existing in another column

    Thanks all,

    Got it working perfectly (ended up going down the ISERROR VLOOKUP route).

    Cheers

+ 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: 03-01-2013, 02:01 AM
  2. [SOLVED] Create code for a new field to return different values depending on existing data.
    By DrNerj in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2012, 11:04 AM
  3. Searching data in 1 row, giving back data from column thats left to searched data
    By AmiGoCS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-29-2012, 05:16 PM
  4. Determining if sheet has existing data and further actions depending on it
    By xyz123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2008, 10:33 AM
  5. Hide column depending giving value in another worksheet
    By ss_bb_24 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-20-2008, 04:16 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