+ Reply to Thread
Results 1 to 16 of 16

Compare two columns and show only the difference in the third column

  1. #1
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Compare two columns and show only the difference in the third column

    Seasons Greetings!

    I'll cut to the chase, I have Col F and Col G with strings that I would like to compare and then have Col H display the difference.

    Example:
    Col F has :KIWI,MEDC,NETB,PTXl,SAL,TAX,WCMO,WDPD,WEFD,WEPD
    Col G has :KIWI,MEDC,NETB,PTXl,SAL,SIC,TAX,WCMO,WDPD,WEFD,WEPD
    Col H would show: SIC

    I want a formula that will look at the two and display the difference in the next column Col H

    The difference in this example, would be the SIC code in col G

    Any ideas?

  2. #2
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Compare two columns and show only the difference in the third column

    Try PowerQuery (Get&Transform)
    in short: merge two tables (in this case two single columns) use conditional column, remove two source columns then remove null value from conditional column and load result table wherever you want

  3. #3
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Re: Compare two columns and show only the difference in the third column

    Thanks for the suggestion, however my solution needs to be in a cell formula, as this will actually go in a google sheet.

    I have searched the web for Google scripts that could do a compare but slim pickings for a workable result.

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Compare two columns and show only the difference in the third column

    so you should ask moderator to move this thread to this part of forum: For Other Platforms(Mac, Google Docs, Mobile OS etc)

    edit: use Report Post from your first post

  5. #5
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Re: Compare two columns and show only the difference in the third column

    Thanks, i still think this is relevant to sit where it is.

    After all it is a MS Excel formula that I am looking for.
    The endgame of where that formula goes should not really have an impact.
    This is meant in the nicest possible way

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Compare two columns and show only the difference in the third column

    not really but it's up to you
    have a nice day

  7. #7
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Compare two columns and show only the difference in the third column

    .
    This macro highlights the differences between both columns, within each column. It does not use a third column for notification.
    Will this do ?

    Please Login or Register  to view this content.
    https://stackoverflow.com/questions/...ll-differences

  8. #8
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,459

    Re: Compare two columns and show only the difference in the third column

    Formula solution:

    Please Login or Register  to view this content.
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

    Drag down as far as you can
    Attached Images Attached Images
    Quang PT

  9. #9
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Re: Compare two columns and show only the difference in the third column

    Thanks for the reply.

    Sorry, I should have stated my question differently.
    I need a formula to compare two cells, rather than two columns.

    The formula needs to (for example) compare the string in F1 against the string in H1 and display in I1 what is missing. In this case, it would be the SIC code.

    I have been playing around with the following formula, but i don't want to have it display a predefined text, I would like to have the result be of the missing string.
    Please Login or Register  to view this content.
    We seem like we are on the same wave length, do you think you could help either change my formula or write a new one?

  10. #10
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,009

    Re: Compare two columns and show only the difference in the third column

    .
    Please Login or Register  to view this content.
    Paste in I1 and drag down.

  11. #11
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Re: Compare two columns and show only the difference in the third column

    Thanks for the reply.

    I am wanting to have only the missing value in Col I, not the entire string.

  12. #12
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Compare two columns and show only the difference in the third column

    Try

    I2
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Copy down!

    Row\Col
    F
    G
    H
    I
    1
    Result
    2
    KIWI KIWI SIC
    3
    MEDC MEDC
    4
    NETB NETB
    5
    PTXl PTXl
    6
    SAL SAL
    7
    TAX SIC
    8
    WCMO TAX
    9
    WDPD WCMO
    10
    WEFD WDPD
    11
    WEPD WEFD
    12
    WEPD
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

  13. #13
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Re: Compare two columns and show only the difference in the third column

    Thanks for the reply.

    The important part is the data stay in one row, since i will have 100's of these checks to do.

    This image (hopefully it attached), is how I would like it to look.


    Example.png
    Last edited by DanzaNZ; 12-13-2017 at 01:46 AM. Reason: image to attach

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,148

    Re: Compare two columns and show only the difference in the third column

    UDF

    Please Login or Register  to view this content.
    in H2

    =Find_text(F2,G2)
    Attached Files Attached Files
    Last edited by JohnTopley; 12-13-2017 at 02:32 AM. Reason: Added file

  15. #15
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Re: Compare two columns and show only the difference in the third column

    Thanks for the input, i can't have it as a macro due to how this sheet will be used.
    I need it to be in a formula or javascript if there is not formula option.

  16. #16
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Compare two columns and show only the difference in the third column

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

+ 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: 02-17-2020, 01:00 PM
  2. [SOLVED] Compare 2 columns with 1 column and highlight difference
    By pradeepdeepu_001 in forum Excel General
    Replies: 3
    Last Post: 12-15-2016, 02:11 AM
  3. Compare and show difference
    By rodge86 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-01-2014, 08:06 AM
  4. Replies: 1
    Last Post: 04-26-2014, 08:28 AM
  5. Compare two reports and show difference in another tab
    By humsboyle in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-31-2013, 01:49 PM
  6. How to compare two columns and print the difference in third column
    By ssing202 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 12-06-2011, 01:45 AM
  7. Replies: 7
    Last Post: 01-30-2005, 02:06 PM

Tags for this Thread

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