+ Reply to Thread
Results 1 to 5 of 5

Concatenate unless blank

  1. #1
    Registered User
    Join Date
    04-04-2014
    Location
    Oregon
    MS-Off Ver
    MS 365 Enterprise
    Posts
    29

    Concatenate unless blank

    I have a spreadsheet with about 60 columns, each containing a number no longer than 3 digits. I need to combined the numbers in each row into one cell with a "|" between each number. I know how to do that and am successful with that part. The complication is that for each row, there will not be a number in every cell, and when the concatenate formula is applied, I need it to "skip" or overlook the empty cells so that I don't end up with double separators with no number in between.

    I've inserted or attached an example that shows in Row 1 what I get in column K when I use concatenate and all the cells contain a number. Row 2 is what I am getting when that same formula is applied and NOT every cell contains a number. Row 3 shows what I need the cell in column K to show (which I manually entered for this example). Can someone tell me how to get this result with a formula?

    example.jpg

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Concatenate unless blank

    =substitute(trim(a2&" "&b2&" "&c2&" "&d2&" "&e2&" "&f2&" "&g2&" "&h2&" "&i2&" "&j2)," ","|")

    I just concatenate them all with a space between, evaluate that with Trim which removes leading and trailing spaces, and makes multiple spaces into singles, and then replace all the single spaces with bar-thingies.
    Last edited by daffodil11; 06-19-2014 at 04:20 PM.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    04-04-2014
    Location
    Oregon
    MS-Off Ver
    MS 365 Enterprise
    Posts
    29

    Re: Concatenate unless blank

    OMG....thank you SO SO much...and you were so quick too! This is EXACTLY what I needed!! Works like charm!

  4. #4
    Registered User
    Join Date
    04-04-2014
    Location
    Oregon
    MS-Off Ver
    MS 365 Enterprise
    Posts
    29

    Re: Concatenate unless blank

    OMG....thank you SO SO much...and you were so quick too! This is EXACTLY what I needed!! Works like charm!

    I have no idea how to "add to your rep" or give you stars or what not, but when I figure it out I will definitely do it! Thanks again!!

  5. #5
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Concatenate unless blank

    No problem

    I'm not doing it for the glory, anywho. Glad I could help out.

+ 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] Concatenate If Blank - remove blank line if first cell is blank
    By ker9 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-27-2014, 02:14 PM
  2. [SOLVED] Concatenate non-blank cells
    By tone640 in forum Excel General
    Replies: 4
    Last Post: 05-16-2012, 05:31 AM
  3. Concatenate blank spaces
    By jivs in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-16-2007, 04:41 PM
  4. Concatenate Non Blank Cells
    By ssjody in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-31-2005, 08:30 AM
  5. [SOLVED] COPY A CONCATENATE CELL TO BLANK CELL PUTTING IN THE NEXT BLANK C.
    By QUEST41067 in forum Excel General
    Replies: 1
    Last Post: 01-15-2005, 06:06 PM

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