+ Reply to Thread
Results 1 to 4 of 4

Compare 2 Columns, Copy to 3rd Column

  1. #1
    Registered User
    Join Date
    01-23-2019
    Location
    South Africa
    MS-Off Ver
    Office Home & Business 2013
    Posts
    2

    Compare 2 Columns, Copy to 3rd Column

    Hi All,

    I am trying to do the following:
    I have 2 text Columns I'm trying to compare. If they are equal to each other I need to copy the value from one of the columns to a 3rd column. Secondly if one column is null and the other is not. I need to then copy the none null column text to the 3rd column. I have no idea how to achieve this.
    BASIC EXPLANATION
    1. IF Column a = b, copy a to c
    2. IF Column a is not null but column b is null, copy a to c
    3. IF Column b is not null but column a is null, copy b to c
    4. IF Column a is null and column b is null, insert text "MISSING" to column c

    Any help will be much appreciated
    Last edited by Danroid; 01-23-2019 at 03:26 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,558

    Re: Compare 2 Columns, Copy to 3rd Column

    Welcome to the forum!

    I think the first should be moot based on the rest. Try this in C1:

    =IF(AND(A1="",B1=""),"MISSING",IF(A1="",B1,A1))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    01-23-2019
    Location
    South Africa
    MS-Off Ver
    Office Home & Business 2013
    Posts
    2

    Re: Compare 2 Columns, Copy to 3rd Column

    Thank you !!!!

    Your solution worked

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2406 (Windows 11 23H2 64-bit)
    Posts
    82,558

    Re: Compare 2 Columns, Copy to 3rd Column

    No problem!

+ 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: 6
    Last Post: 09-21-2016, 04:21 PM
  2. Compare multiple columns (column A,column B,Column C) and return value (Column D)
    By john008 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-21-2015, 08:24 AM
  3. [SOLVED] Compare two columns and copy and paste data from a third column when a match is found
    By GatorsBucs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-28-2013, 06:54 PM
  4. Compare 2 columns and copy new values from the 2nd columns to a 3rd column
    By djarcadian in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-02-2013, 12:18 PM
  5. [SOLVED] Compare 2 pair of columns then copy value of third column over different sheets
    By a3des in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-13-2012, 09:11 AM
  6. [SOLVED] Compare 4 column values then insert a 5th columns value to a blank column/cell value
    By JasonKMcCoy in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-27-2012, 06:01 PM
  7. Compare Two Columns In Two Worksheets To Copy And Paste A Third Column
    By uopint in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-20-2007, 05:03 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