+ Reply to Thread
Results 1 to 28 of 28

merge cells

  1. #1
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    merge cells

    Hi to all,
    this formula in cell contains "AAAA-" merge cell B3:B4

    =IF(LEFT(B4,5)="AAAA-",B3&SUBSTITUTE(B4,"AAAA-",""),"")

    i can't edit for cells without "AAAA-"
    see attached example
    john
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-05-2017
    Location
    Brazil
    MS-Off Ver
    Microsoft 365 Version 2412
    Posts
    1,515

    Re: merge cells

    Try in C3 and copy down:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Buona fortuna!

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: merge cells

    Maybe try

    =IF(ISTEXT(B4),B3&MID(B4,6,20),IF(ISTEXT(B3),"",B3))
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    Re: merge cells

    Hi bo_ry thank you, it's ok.
    A greeting
    john

    Thanks also a estevaoba
    yuor formula work well
    A greeting
    john
    Last edited by john_cash; 09-05-2020 at 08:53 AM.

  5. #5
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    Re: merge cells

    Hi bo_ry.
    thank you again
    Could the second merged cell be wrap text?

    now is
    12345612345678 ASD ASD ASD

    it must be
    12345612345678
    ASD ASD ASD

    john
    Attached Files Attached Files
    Last edited by john_cash; 09-05-2020 at 09:20 AM.

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: merge cells

    If you would show the data for presentation reason, i would not break the line in 2 parts, but use this one instead.

    The reason for this is that I expect problems, using the result of that formula in the future.


    G3 =IF(AND(ISNUMBER(B3),ISTEXT(B4)),1,IF(AND(ISTEXT(B3),ISNUMBER(B4)),2,IF(AND(ISTEXT(B3),ISBLANK(B4)),4,3)))

    F3 =IF(G3=3,B3,IF(OR(G3=2,G3=4),RIGHT(C2,LEN(C2)-SEARCH(" ",C2,1)-1),IF(G3=1,LEFT(C3,SEARCH(" ",C3,1)-1),"")))

    See the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: merge cells

    Please try at C3
    =IF(ISTEXT(B4),SUBSTITUTE(TRIM(B3&MID(B4,6,50))," ",CHAR(10),1),IF(ISTEXT(B3),"",B3))
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    Re: merge cells

    Hi bo_by
    I'm sorry but I made the wrong change
    wrap text must be:

    now your new change is
    12345612345678
    ASD ASD ASD

    it must be
    123456
    12345678 ASD ASD ASD

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: merge cells

    I've arrived here a bit late, but maybe on row 3

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

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  10. #10
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,222

    Re: merge cells

    Try at C3
    =IF(ISTEXT(B4),TRIM(B3&CHAR(10)&MID(B4,6,50)),IF(ISTEXT(B3),"",B3))

  11. #11
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    Re: merge cells

    Hi bo_ry the new modified work well, thank you.
    A greeting.
    john

    For richard buttrey the your formula work well but wrap text doesn't work.

    it must be so
    123456
    A2345678 ASD ASD ASD

    your formula is now
    123456A2345678 ASD ASD ASD

  12. #12
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: merge cells

    @john_cash

    you did not reply on my solution.

  13. #13
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: merge cells

    Quote Originally Posted by john_cash View Post
    Hi bo_ry the new modified work well, thank you.
    A greeting.
    john

    For richard buttrey the your formula work well but wrap text doesn't work.

    it must be so
    123456
    A2345678 ASD ASD ASD

    your formula is now
    123456A2345678 ASD ASD ASD
    Re the Wrap Text. It will work if you select those columns and choose the Wrap Text option on Excel's Ribbon menu to format the cells.

  14. #14
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    Re: merge cells

    Thanks you richard buttrey

  15. #15
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    Re: merge cells

    Because in cell B5 if it's just number it works, but if it's text or text and number doesn't it work anymore?
    Attached Files Attached Files
    Last edited by john_cash; 09-05-2020 at 02:05 PM.

  16. #16
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    Re: merge cells

    Hi oeldere
    i saw your formula now but the result must be in a cell like formulas bo_ry and richard buttrey

  17. #17
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: merge cells

    @john_cash

    The reason for this is that I expect problems, using the result of that formula in the future.
    The result will not be used in another formula?

  18. #18
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    Re: merge cells

    oeldere, I don't understand what you mean

  19. #19
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: merge cells

    The result of the "wrapped" formula.

    If that result is in e.g. C3.

    Will you use the result of C3 in a formula in e.g. F2.

    In that case I expect problems using char(10).

  20. #20
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    Re: merge cells

    sorry oeldere but I don't understand how to use your formulas

  21. #21
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: merge cells

    cell G3 =IF(AND(ISNUMBER(B3),ISTEXT(B4)),1,IF(AND(ISTEXT(B3),ISNUMBER(B4)),2,IF(AND(ISTEXT(B3),ISBLANK(B4)),4,3))) and drag down.

    cell F3 =IF(G3=3,B3,IF(OR(G3=2,G3=4),RIGHT(C2,LEN(C2)-SEARCH(" ",C2,1)-1),IF(G3=1,LEFT(C3,SEARCH(" ",C3,1)-1),""))) and drag down.

  22. #22
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    Re: merge cells

    Oldere, it's incorrect.
    In the attached example

    F3:F4 they must be merge
    F6:F7 they must be merge
    F8:F9 they must be merge
    F11:F12 they must be merge

    F5 and F10 it must remain single

  23. #23
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: merge cells

    Quote Originally Posted by john_cash View Post
    Hi bo_ry the new modified work well, thank you.
    A greeting.
    john

    For richard buttrey the your formula work well but wrap text doesn't work.

    it must be so
    123456
    A2345678 ASD ASD ASD

    your formula is now
    123456A2345678 ASD ASD ASD
    I presume after you've applied the text wrap formatting to the columns that it now gives you what you want. If not upload the workbook so that we can check what you've entered.
    Last edited by Richard Buttrey; 09-07-2020 at 07:06 AM.

  24. #24
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    Re: merge cells

    For richard buttrey:

    example in B2 if 123456 work, if AAA 123456 not work
    Attached Files Attached Files

  25. #25
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    Re: merge cells

    I badly explained myself?

  26. #26
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: merge cells

    @john_cash

    I badly explained myself?
    You did not add to whom you are replying.

  27. #27
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: merge cells

    Quote Originally Posted by john_cash View Post
    For richard buttrey:

    example in B2 if 123456 work, if AAA 123456 not work
    Hi,

    Rather than just saying it doesn't work you need to make sure that the workbook you upload contains all permutations of data, and by permutations that means including different succeeding cells where these are relevant to what you see in an earlier cell.

    In other words we need you to manually add what you expect to see. For instance you are indicating C5 is wrong, but don't show what you do expect to see and importantly WHY.

    Please create a workbook with various permtuations with manually added results and upload the workbook

  28. #28
    Forum Contributor
    Join Date
    10-31-2018
    Location
    venezia
    MS-Off Ver
    2007
    Posts
    492

    Re: merge cells

    Hi richard example in post #24

+ 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. Repeat column name, N times, Merge cells, Hide cells
    By ionelz in forum Excel General
    Replies: 12
    Last Post: 03-15-2020, 09:53 AM
  2. Replies: 11
    Last Post: 04-04-2017, 03:49 PM
  3. [SOLVED] Macro merge cells separated by comma, ignore blank cells
    By lagiosman in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-22-2014, 04:49 PM
  4. Replies: 2
    Last Post: 01-22-2014, 02:35 PM
  5. Merge data from cells on 2nd columns in which the cells of 1st column repeat
    By jagke in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-14-2013, 01:06 PM
  6. Replies: 2
    Last Post: 07-20-2006, 09:05 AM
  7. [SOLVED] MERGE CELLSHow to merge two cells in excel?
    By laure abbass in forum Excel General
    Replies: 1
    Last Post: 11-10-2005, 01:50 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