+ Reply to Thread
Results 1 to 8 of 8

Formula to search a Column with Cell content from another Column?

  1. #1
    Registered User
    Join Date
    09-17-2012
    Location
    Oregon
    MS-Off Ver
    Excel 2010
    Posts
    4

    Formula to search a Column with Cell content from another Column?

    I'm trying to compare two columns of user names against each other so I can delete obsolete users in the 2nd column.

    IE Column A has:
    JaneDoe
    JohnDoe
    JaneSmith

    Column C has:
    JaneDoe
    JohnDoe
    JohnSmith
    JaneSmith


    I've tried =IF(A:A=C1, "Keep", "Delete") and that doesn't work because it's looking for "=C1" in the A column. I have also tried =IF(ISNUMBER(SEARCH("JaneDoe",A:A)),"OK", "Not OK") which does work in searching the entire column A but I have over 900 rows in both columns and don't want to edit each individual search where JaneDoe is put and want it to do a cell reference from C instead.

    Any suggestions?
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    02-04-2009
    Location
    Texas
    MS-Off Ver
    Excel 2016
    Posts
    667

    Re: Formula to search a Column with Cell content from another Column?

    =iferror(if(countif(A:A,$C1)>1,"Delete","Keep"),"Keep")
    iferror: if it does not find C1 in A:A the formula would result in error.
    >1 there is more than one C1 in column A:A
    $C1 the $ makes the C fixed - if you copy this down the formula, row 2 would show $C2 etc...

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula to search a Column with Cell content from another Column?

    The result is in the red cells.

    See the file.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    09-17-2012
    Location
    Oregon
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Formula to search a Column with Cell content from another Column?

    Quote Originally Posted by CRIMEDOG View Post
    >1 there is more than one C1 in column A:A
    $C1 the $ makes the C fixed - if you copy this down the formula, row 2 would show $C2 etc...
    The results I get from directly pasting your suggestion = Keep for all.

    What I'm looking for is to make the "C1" not actually search for C1 but the contents of what is in the column/field of C1. IE JaneDoe

  5. #5
    Registered User
    Join Date
    09-17-2012
    Location
    Oregon
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Formula to search a Column with Cell content from another Column?

    Quote Originally Posted by oeldere View Post
    The result is in the red cells.

    See the file.
    Woah! Nicely done. I would not have even thought of that route. Thank you.

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Formula to search a Column with Cell content from another Column?

    Glad I could help. Thanks for the reply.

    If you have (other) questions, on this item, just ask.

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Formula to search a Column with Cell content from another Column?

    @ GabeZ

    Welcome to the forum.

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  8. #8
    Registered User
    Join Date
    09-17-2012
    Location
    Oregon
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Formula to search a Column with Cell content from another Column?

    Thanks Cutter. I'll make sure to do so in the future.

+ 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