+ Reply to Thread
Results 1 to 16 of 16

How to ignore blank cells while concatenating multiple cell values

  1. #1
    Registered User
    Join Date
    12-27-2016
    Location
    Chennai, India
    MS-Off Ver
    2013
    Posts
    9

    Question How to ignore blank cells while concatenating multiple cell values

    Hi,

    I am trying to concatenate multiple cell values in one cell as below:

    Column A Column B Column C Column D Column E Column F
    Blank Text 1 Text 2 Blank Text 3 I am concatenating values from A to E

    My formula is

    A1&CHAR(10)&B1&CHAR(10)&C1&CHAR(10)&D1&CHAR(10)&E1

    What I am getting in Column F is

    Blank
    Text 1
    Text 2
    Blank
    Text 3

    What I am looking for is

    Text 1
    Text 2
    Text 3

    Can anyone help me with the right formula?

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to ignore blank cells while concatenating multiple cell values

    Try it like this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Registered User
    Join Date
    12-27-2016
    Location
    Chennai, India
    MS-Off Ver
    2013
    Posts
    9

    Re: How to ignore blank cells while concatenating multiple cell values

    Hi, Thanks for your quick reply. But, I am getting a totally blank Col F if I apply this formula. I am not able to attach my file, but my Column F is totally blank now after applying your formula.

  4. #4
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: How to ignore blank cells while concatenating multiple cell values

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


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  5. #5
    Registered User
    Join Date
    12-19-2016
    Location
    Rawalpindi, Pakistan
    MS-Off Ver
    MS Office 2016.
    Posts
    18

    Re: How to ignore blank cells while concatenating multiple cell values

    One way:

    =A1 & B1 & C1

    If any cells are blank, they'll be ignored.

    Note that by "blank" I mean truly blank. If you or your users are in the habit of "blanking" a cell by using the space bar, the cell(s) actually contain space characters. To ignore those:

    =IF(LEN(TRIM(A1))=0,"",A1) & IF(LEN(TRIM(B1))=0,"" B1) & IF(LEN(TRIM(C1))=0,"",C1)

    or, depending on your particular circumstances, this might work just as well:

    =TRIM(A1 & B1 & C1)

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: How to ignore blank cells while concatenating multiple cell values

    Do your text strings contain spaces, or are they ALWAYS a continuous string of characters?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: How to ignore blank cells while concatenating multiple cell values

    There MUST be a simpler way than this...

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


    Don't forget to enable text wrapping. This removes double char 10s and any single char 10 at the start of the string.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    12-27-2016
    Location
    Chennai, India
    MS-Off Ver
    2013
    Posts
    9

    Re: How to ignore blank cells while concatenating multiple cell values

    This formula adds a "return" even if there is a gap in between the words in one cell. The result is

    Text
    1
    Text
    2
    Text
    3

    I am expecting to get the result

    Text 1
    Text 2
    Text 3

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: How to ignore blank cells while concatenating multiple cell values

    Who are you replying to????????

  10. #10
    Registered User
    Join Date
    12-27-2016
    Location
    Chennai, India
    MS-Off Ver
    2013
    Posts
    9

    Re: How to ignore blank cells while concatenating multiple cell values

    Sorry, that reply was to AlKey.

  11. #11
    Registered User
    Join Date
    12-27-2016
    Location
    Chennai, India
    MS-Off Ver
    2013
    Posts
    9

    Re: How to ignore blank cells while concatenating multiple cell values

    Glenn, your formula has come closer to my requirement. I am trying to attach a file which specifies what I am doing and I am looking for.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    12-27-2016
    Location
    Chennai, India
    MS-Off Ver
    2013
    Posts
    9

    Re: How to ignore blank cells while concatenating multiple cell values

    Glenn,

    I have attached a file in my previous post and have given examples of what I am trying to do.

    "Error List" column is where I am trying to collect the errors against each employee. I wanted to ignore the blank cells while collecting the errors.

  13. #13
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: How to ignore blank cells while concatenating multiple cell values

    There is no a perfect way of concatenating text strings with a formula unless you are a subscriber of Office 365 which offers a great excel function TEXTJOIN.
    However, there is a good news! You can get the same functionality with a VBA version.
    Here is how to do this:

    1. Copy code below
    2. Press Alt and F11 on your keyboard to open VB Editor
    3. Click on Insert and select Module
    4. Paste code into Module and close VB Editor.

    Don't forget to save your worbook as Macro-Enabled workbook.

    http://www.get-digital-help.com/2016...tjoin-function

    Please Login or Register  to view this content.
    Then enter formula in a cell F1 and click on Wrap Text located on the Home tab and copy formula down if needed.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B C D E F
    1 Text 1 Text 12 Text 2 Text 3 Text 1
    Text 12
    Text 2
    Text 3
    2 Text 1 Text 2 Text 3 Text 1
    Text 2
    Text 3
    3 Text 1 Text 1

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: How to ignore blank cells while concatenating multiple cell values

    I would go with Alkey's UDF, for sure... A formula for so many columns would be horrible!!

  15. #15
    Registered User
    Join Date
    12-27-2016
    Location
    Chennai, India
    MS-Off Ver
    2013
    Posts
    9

    Re: How to ignore blank cells while concatenating multiple cell values

    Thanks AlKey. It's really working fine. I have added the formula =TEXTJOIN(CHAR(10),TRUE,A1:E1) in F1, but I get #VALUE! if there is no message (i.e. no text) for an employee in a row. How to avoid, i.e. how to make F1 blank if there is no message in a row or rows?

  16. #16
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: How to ignore blank cells while concatenating multiple cell values

    Try
    =iferror(TEXTJOIN(CHAR(10),TRUE,A1:E1),"")

+ 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. Ignore blank cells from most common values
    By Wazo11 in forum Excel General
    Replies: 1
    Last Post: 05-12-2016, 01:10 AM
  2. If cells are blank, ignore them. Multiple formulas!
    By EYRESADAM in forum Excel General
    Replies: 7
    Last Post: 04-28-2016, 05:02 PM
  3. Copy Range and Paste only Values (ignore blank cells)
    By ksayet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2015, 04:37 PM
  4. [SOLVED] Get top 10 values but ignore with blank cell if there's less than 10 values
    By werko in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-22-2015, 09:16 PM
  5. Replies: 0
    Last Post: 11-05-2014, 10:54 AM
  6. How to ignore blank cells with multiple if scenarios based on text
    By KirtyLou in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-12-2014, 01:10 PM
  7. [SOLVED] Ignore If Blank & check multiple cells for equal values
    By Urugmo88 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-25-2013, 04:46 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