+ Reply to Thread
Results 1 to 4 of 4

Long 'IF' formula troubles

  1. #1
    Registered User
    Join Date
    05-04-2016
    Location
    Portsmouth, England
    MS-Off Ver
    MS Office 2010
    Posts
    2

    Long 'IF' formula troubles

    Hi all,

    I have a dataset of people's names, where their full name (e.g Mr. John Smith) is in one column and the surname is in the next. I would like to create a formula that allows me to split out their salutation (e.g Mr, Mrs, Mr and Mrs, Herr, Frau etc) and list it as a single variable in another column.

    I tried to adapt an 'IF' formula I found in another thread but Excel said I had too many rules. Does anyone know of a way that I can do this?

    Thanks

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

    Re: Long 'IF' formula troubles

    It will help if you can post a file with a good set of sample data so we can see the variability in the data.

    To upload a file, click "Go Advanced" then "Manage attachments"

  3. #3
    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,933

    Re: Long 'IF' formula troubles

    Agree a sample file will help, but assuming your data looks something like this...
    A
    B
    C
    D
    1
    Mr aa bb Mr aa bb
    2
    Mr. aa bb Mr aa bb
    3
    Mrs aa bb Mrs aa bb
    4
    Mrs. aa bb Mrs aa bb

    B1=SUBSTITUTE(TRIM(MID(SUBSTITUTE($A1," ",REPT(" ",LEN($A1))),LEN($A1)*(COLUMN()-2)+1,LEN($A1))),".","")
    copied down and across as needed
    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

  4. #4
    Registered User
    Join Date
    05-04-2016
    Location
    Portsmouth, England
    MS-Off Ver
    MS Office 2010
    Posts
    2

    Re: Long 'IF' formula troubles

    I'm sorry guys, but I can't share the data file as it contains people's personal information. It looks a bit like below though. Ideally I would like column C to house the salutation.

    A B
    Full Name Surname
    1 Mr John Jones Jones
    2 Mrs Sam Smith Smith
    3 Mr and Mrs Steve Doe Doe
    4 Herr Klaus Schmid Schmid
    5 Frau Laura Weber Weber

+ 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. [SOLVED] If formula troubles.
    By Lehany in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-05-2015, 02:18 PM
  2. [SOLVED] If formula troubles
    By Lehany in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-29-2015, 01:50 PM
  3. Counting Formula Troubles
    By stacey52891 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-09-2013, 12:41 PM
  4. Excel formula troubles
    By redous in forum Excel General
    Replies: 10
    Last Post: 04-15-2012, 03:27 AM
  5. Formula troubles
    By azizrasul in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2008, 10:04 AM
  6. Formula troubles
    By egeorge4 in forum Excel General
    Replies: 5
    Last Post: 02-24-2006, 03:45 PM
  7. [SOLVED] Formula Troubles........
    By Tracy B in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-08-2005, 11:06 AM

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