+ Reply to Thread
Results 1 to 9 of 9

Using IF-THEN-ELSE to convert "M" to "Mr", "F" to "Ms" ELSE leave "Blank".

  1. #1
    Registered User
    Join Date
    12-31-2012
    Location
    Denver, CO, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Using IF-THEN-ELSE to convert "M" to "Mr", "F" to "Ms" ELSE leave "Blank".

    Greetings!

    I've perused about 50 pages across the Forum and haven't found anything similar to use or glean to do what I would like to accomplish. I used to know how to do this (in my youth, with Supercalc3 and Lotus 1-2-3) and drawing blanks when it comes to Excel 2007.

    I have a column with my prospects "Gender" - with answers of either "M", "F" or Blank, for Male, Female on Unknown (unverified, actually).
    I'd like to create a macro or formula to read and convert a copy of that Column to "Mr.", "Ms." or to leave blank (as is) if blank.

    I've played around with the "=IF" formula but have gotten stuck.

    I would appreciate any direction or guidance to this basic Excel formula problem. Thanks!

    Regards,

    Dan

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Using IF-THEN-ELSE to convert "M" to "Mr", "F" to "Ms" ELSE leave "Blank".

    =IF(A1 = "M","Mr.",IF(A1 = "F","Ms.",""))
    Martin

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Using IF-THEN-ELSE to convert "M" to "Mr", "F" to "Ms" ELSE leave "Blank".

    Hi Midwicket,

    Try this:
    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Using IF-THEN-ELSE to convert "M" to "Mr", "F" to "Ms" ELSE leave "Blank".

    You could instead just select the column and replace M with Mr. and F with Ms.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Registered User
    Join Date
    12-31-2012
    Location
    Denver, CO, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Using IF-THEN-ELSE to convert "M" to "Mr", "F" to "Ms" ELSE leave "Blank".

    great - thanks for your help!
    Happy New Year!

  6. #6
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: Using IF-THEN-ELSE to convert "M" to "Mr", "F" to "Ms" ELSE leave "Blank".

    Midwicket, welcome to the forum.

    Assuming your data is in A1, in A2 paste the following:

    Please Login or Register  to view this content.
    Hope this helps.
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

  7. #7
    Registered User
    Join Date
    12-31-2012
    Location
    Denver, CO, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Using IF-THEN-ELSE to convert "M" to "Mr", "F" to "Ms" ELSE leave "Blank".

    Thanks! It worked perfectly!
    Happy New Year!

    Dan

  8. #8
    Registered User
    Join Date
    12-31-2012
    Location
    Denver, CO, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Using IF-THEN-ELSE to convert "M" to "Mr", "F" to "Ms" ELSE leave "Blank".

    Thanks mate!
    Happy New Year!

    Cheers!

    Dan

  9. #9
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Using IF-THEN-ELSE to convert "M" to "Mr", "F" to "Ms" ELSE leave "Blank".

    Happy New Year!

+ 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