+ Reply to Thread
Results 1 to 4 of 4

Using an IF statement and concatenating data from 4 different cells

  1. #1
    Registered User
    Join Date
    02-28-2018
    Location
    Brandenburg, KY
    MS-Off Ver
    2013
    Posts
    1

    Using an IF statement and concatenating data from 4 different cells

    Trying to create a cell in which an individuals name is put in proper order and using the IF statement when the individuals name does or does not have a middle initial.

    D E F G
    1 Mr. Smith John B.

    As an example you can see the columns D through G in row 1.

    So I inserted a formula in column H1: =IF(G1=" ",D1&" "&F1&" "&E1,D1&" "&F1&" "&G1&"."&" "&E1)

    If I have a name that does not have a middle initial (such as B in the example above) then I should not get any middle initial or a period. But I always get a . (period) whether there is a middle initial or not. What am I doing wrong in this formula?

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.83 for Mac MS 365
    Posts
    8,480

    Re: Using an IF statement and concatenating data from 4 different cells

    is this what you are looking for? =IF(G1<>"",D1&" "&F1&" "&E1,D1&" "&F1&" "&G1&"."&" "&E1,"")
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Using an IF statement and concatenating data from 4 different cells

    If you take the space out from between the first set of quotes (the ones after G1=) does it work then?

    BSB

  4. #4
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Using an IF statement and concatenating data from 4 different cells

    Try taking out space from " " in first part of your formula.
    instead of G1=" " try G1=""
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

+ 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. Concatenating cells containing multiple lines of data
    By Lenny67 in forum Excel General
    Replies: 4
    Last Post: 07-17-2017, 06:26 AM
  2. Concatenating data in cells into 1 cell?
    By huShn0w in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-08-2016, 11:28 AM
  3. [SOLVED] Concatenating two columns and reversing after concatenating the result
    By irfanparbatani in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-22-2014, 09:35 PM
  4. Concatenating values for duplicate data cells
    By thefuzzybear in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 09-16-2013, 10:41 PM
  5. [SOLVED] Concatenating cells where one contains Pipe delimited data
    By Acedge in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-04-2012, 12:25 PM
  6. Replies: 5
    Last Post: 08-12-2011, 02:33 PM
  7. Concatenating data from two cells and importing data from other sheets?
    By Brad4444 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-04-2011, 01:30 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