+ Reply to Thread
Results 1 to 6 of 6

Populate one column with data based on another column.

  1. #1
    Registered User
    Join Date
    07-04-2013
    Location
    Florida, United States
    MS-Off Ver
    Excel 2013
    Posts
    11

    Populate one column with data based on another column.

    I am new to excel and I am trying to add a salutation (e.g. Mr., Mrs. and Ms.) to every name in a list. The list sizes will change, so I need the amount of rows to go to the end of data and not to a set amount.


    Column B = Salutation
    Column D = First name

    If D6 = Steve I need B6 to be Mr. or if D3 = Megan I need B3 to be Ms.

  2. #2
    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,945

    Re: Populate one column with data based on another column.

    Hi and welcome to the forum

    Im sure that Steve and Megan are not the only names you have? If they are, then in B6, copied down, maybe something like...

    =if(D6="Steve", "Mr","Mrs")
    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

  3. #3
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Populate one column with data based on another column.

    Try this one too..

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


    @ FDibbins:

    If you are planning for something interesting.. then visit here..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  4. #4
    Forum Contributor codeslizer's Avatar
    Join Date
    05-28-2013
    Location
    Mumbai, India
    MS-Off Ver
    Excel 2003 - 2010
    Posts
    245

    Re: Populate one column with data based on another column.

    Hey Ronnie,
    understanding your requirement, I believe you require two more columns - gender and marital status, so if married and female you can reflect the salutation as "Mrs", or else she'll be "Ms." and if male its "Mr."

    So if your columns B, C, D, E and F are arranged in such order..

    | Title | LastName | FirstName | Gender | Marital Status |

    then in B2 we write the formula as

    Please Login or Register  to view this content.
    It checks for if FirstName and Gender if provided, coz we cannot set a title by just knowing someone's name. If yes, and if its Male, puts straight "Mr.". If Female, then waits for Marital Status to be provided. If yes, then checks for if its Single (Unmarried) or Married. You can further classify it to Divorced, Widow, etc.

    Hope that helps!

  5. #5
    Registered User
    Join Date
    07-04-2013
    Location
    Florida, United States
    MS-Off Ver
    Excel 2013
    Posts
    11

    Re: Populate one column with data based on another column.

    I'm sorry but I should have said that there were many different names, I was just giving examples. I need a macro to go through the list and adding Ms. or Mr. to any names that I can think of adding so that I can speed up the process. Currently I am organizing the table from a --> z and then if the name is Bob I Enter Mr. and drag to fill it for all the Bobs. If the name is Beth I add Ms. and drag the autofill to the end of the Beths. I continue that all the way through the list. The Unisex names I just leave blank.

    If there is more than one name in the cell, like if it has Marge and Rick, I need it to be blank so that I can go in and add Mr. and Mrs. in Salutation. I need for just the Man's name, in this case Rick, to be in First Name.

    Also, we are using a customers list and can,t add gender or marital status. If I have to set up a if and then line for each name I will. i just need to know how to format it.
    Last edited by Ronnie_Greytruck; 07-04-2013 at 02:10 AM.

  6. #6
    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,945

    Re: Populate one column with data based on another column.

    Maybe this suggestion will help?

    In any column (even B) go down the list and enter 1, 2 or 3 depending on what you want the suffix to be. Then when you are done, find/replace 1/Mr 2/Mrs etc

    It's still a laborious process, but that may make it a bit easier. You could even filter on a common name and add the 1, 2 etc (or Mr, Mrs etc) in mass to speed it up

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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