+ Reply to Thread
Results 1 to 11 of 11

Looking for unique values by comparing 2 columns and put them into next column

  1. #1
    Registered User
    Join Date
    09-29-2014
    Location
    Rugby, UK
    MS-Off Ver
    2010
    Posts
    6

    Looking for unique values by comparing 2 columns and put them into next column

    Hi,
    Im having problem finding proper formula. Let me show you first what I need. I have 3 columns
    Column A
    donkey
    horse
    cow
    dolphin

    Column B
    dog
    cat
    mouse
    owl
    donkey
    horse
    cow
    chicken
    rat
    turtle
    baboon
    camel
    dolphin
    monkey
    goat
    koala
    moth
    puma


    So i need a formula which will fill in column C based on column B, but not include whats in colums A. So if something exist in colums A, column C shuold take next cell from column B, but should check if its in column A, if so, use next one, and again check it. I have tried index mixed with vlookup, but can get it right. It gives mi big headache now. Maybe someone here can help me please
    Last edited by barkaba; 10-08-2014 at 09:32 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,857

    Re: Stuck on formula

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    09-29-2014
    Location
    Rugby, UK
    MS-Off Ver
    2010
    Posts
    6

    Re: Stuck on formula

    Sorry, its been done

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Looking for unique values by comparing 2 columns and put them into next column

    Hi.

    Array formula**:

    =IFERROR(INDEX($B$1:$B$18,SMALL(IF(1-ISNUMBER(MATCH($B$1:$B$18,$A$1:$A$4,0)),ROW($B$1:$B$18)-MIN(ROW($B$1:$B$18))+1),ROWS($1:1))),"")

    Note that if your dataset is in reality much larger than the example you posted, i.e. thousands of rows, then please let me know as this set-up should then be tweaked so as to make it more efficient.

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Last edited by XOR LX; 10-08-2014 at 10:47 AM.
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  5. #5
    Registered User
    Join Date
    09-29-2014
    Location
    Rugby, UK
    MS-Off Ver
    2010
    Posts
    6

    Re: Looking for unique values by comparing 2 columns and put them into next column

    Thank you so much, I have spent 2 days trying to sort it. Im gonna have up to 400 cell to compare to, so I think it should be ok. Thanks again

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Looking for unique values by comparing 2 columns and put them into next column

    You're welcome.

    Yes, that size a range should not post too much of a problem with this IFERROR set-up.

    Cheers

  7. #7
    Registered User
    Join Date
    09-29-2014
    Location
    Rugby, UK
    MS-Off Ver
    2010
    Posts
    6

    Re: Looking for unique values by comparing 2 columns and put them into next column

    Hi again, I have another problem with this formula. I didnt expect it, but I gonna have to compare column B to two other columns, not one. Im trying to do this myself using yours formula, but no luck so far. Your help would be greatly appreciated.

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Looking for unique values by comparing 2 columns and put them into next column

    Hi again.

    I think an actual workbook would be beneficial in that case.

    Make sure you replace any confidential data with dummy data if necessary. And also be sure to include your expected results.

    Regards

  9. #9
    Registered User
    Join Date
    09-29-2014
    Location
    Rugby, UK
    MS-Off Ver
    2010
    Posts
    6

    Re: Looking for unique values by comparing 2 columns and put them into next column

    Thanks for quick reply. I can work with what I already got from you, but it can be done what I need, it would simlyfy what I need to do. I have created short version what I need to do, here is the file. I have explained in file what I need exacly. Thank you for your time
    Attached Files Attached Files

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Looking for unique values by comparing 2 columns and put them into next column

    I'm sorry, but the layout is too poor for me to understand. I'm not sure where "here" means in a lot of instances, and everything seems to overlap.

    But more importantly you don't seem to have included your expected results for this dataset, so I'm not sure what I'm aiming for.

    Hopefully someone else will pick up on this thread shortly who can help you.

    Regards

  11. #11
    Registered User
    Join Date
    09-29-2014
    Location
    Rugby, UK
    MS-Off Ver
    2010
    Posts
    6

    Re: Looking for unique values by comparing 2 columns and put them into next column

    Sorry for not explaining it more clearly. I have updated that file, and if you can just take a quick look it please. If its still not clear, don't worry, you have already helped me a lot. Thank you again for your time
    Attached Files Attached Files

+ 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. Need help with a formula. I am stuck :(
    By manno_88 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-16-2013, 06:26 AM
  2. Stuck at work and stuck on a count function
    By gregfetzer in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-24-2012, 12:47 AM
  3. Stuck! Please help with formula
    By mcrubbin in forum Excel General
    Replies: 3
    Last Post: 05-15-2012, 06:07 PM
  4. Stuck on Formula
    By parteegolfer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-06-2006, 12:08 PM
  5. [SOLVED] Formula Help... I'm really stuck here
    By Miko in forum Excel General
    Replies: 4
    Last Post: 09-07-2005, 04:05 PM

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