+ Reply to Thread
Results 1 to 6 of 6

How to merge 2 columns?

  1. #1
    Registered User
    Join Date
    02-11-2022
    Location
    France
    MS-Off Ver
    2021
    Posts
    10

    Question How to merge 2 columns?

    Hello,

    I am looking for some help from an Excel expert.

    I have a table with 2 columns: A and B.
    A contains company names, and B contains domain names.

    I would like to find a formula to merge these two columns, following these 3 rules:
    If there is a value only in column A, then populate the cell in column C with the value of column A.
    If there is a value only in column B, then populate the cell in column C with the value of column B.
    If there is a value in both column A and column B, then populate the cell in column C with the value of column B.

    Do you know a formula to get this outcome?

    I have attached a table with example values.

    Thank you in advance for your help!
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,422

    Re: How to merge 2 columns?

    You can use this formula in cell C2:

    =IF(B2="",A2,B2)

    although you may have to use semicolons ( ; ) rather than commas ( , ) in the formula, depending on your regional settings.

    Copy down as required.

    Hope this helps.

    Pete

  3. #3
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,418

    Re: How to merge 2 columns?

    Power Query
    Please Login or Register  to view this content.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    02-11-2022
    Location
    France
    MS-Off Ver
    2021
    Posts
    10

    Re: How to merge 2 columns?

    Thanks a lot for this! It is very helpful!

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,933

    Re: How to merge 2 columns?

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) 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 each of those who offered help.
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,422

    Re: How to merge 2 columns?

    Glad to help. If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    You might also like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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: 4
    Last Post: 03-03-2019, 02:24 PM
  2. [SOLVED] tricky text formula from several columns and merge in one columns
    By JEAN1972 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-19-2017, 10:54 AM
  3. [SOLVED] Merge duplicate rows and merge the columns (approx 10 columns)
    By adfeddon in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-02-2012, 11:19 AM
  4. [SOLVED] Merge columns if certain number of columns in row
    By FreeThrow in forum Excel General
    Replies: 9
    Last Post: 06-22-2012, 03:04 PM
  5. merge text from 2 columns into 1 then delete the old 2 columns
    By sleepindogg in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-30-2006, 02:30 PM
  6. [SOLVED] Need to merge columns
    By Jay T in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  7. Need to merge columns
    By Jay T in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 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