+ Reply to Thread
Results 1 to 14 of 14

TIP Don't merge if you don't have to.

  1. #1
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    TIP Don't merge if you don't have to.

    I'm not the only one that does not like merged Excel cells; they are frequently hard to debug in another author's work, they get in the way and so on. I looked quickly to see if this tip is about and not finding it, offer it here.

    Sometimes you want a total figure to be shown LARGE.
    It would be too wide to fit the column it SUMs, so you’re tempted to merge two cells to leave room.
    Don't! Cell merges are confusing and often unnecessary.
    Text values happily overlap the next cell(s) as required (if they are empt
    If the total was text, it would cover the next (blank) cell without issue.
    So make it text with the TEXT() function;, e.g. =TEXT(SUM(C$12:C$18),"#,##0") and in this case, right align to overlap into the cell to the left.
    Of course you forma font name, size and bold as you wish.

    Now I wanted to show a picture or sample but I failed the upload files test. But trust me; this saved me a wholemess of trouble when I moved to anew department with numbers (and dates in 23 October 2012 format) would not fit in tight cells. I hope you like it.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: TIP Don't merge if you don't have to.

    Thanks Brynbaker. Thats a useful tip.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: TIP Don't merge if you don't have to.

    Nice idea.Using Format Cells- Alignment - Text Alignment - Horizontal - "Center across selection" (after selecting 2 or more adjacent cells) achieves the same without extra formulas

  4. #4
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: TIP Don't merge if you don't have to.

    Pepe
    achieves the same without extra formulas
    Actuially it doesn't - it centers over two columns which looks pretty silly at the foot of a column of numbers. My tip allows left, right, or centre alignment. I've used it to display a wide date "October 2012" right justified in a heading of a narrow column; It overlaps the cell on the left (which is empty). As a date is numeric, it won't overlap like a text label would do.

    Arlette
    Thats a useful tip.
    From you that's praise, thanks.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,371

    Re: TIP Don't merge if you don't have to.

    Thanks for sharing. Interesting idea, although, if you have a lot of columns of numbers, it might be difficult to implement.,

    I'm all for keeping raw data in one sheet and analysis/presentation elsewhere.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  6. #6
    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,926

    Re: TIP Don't merge if you don't have to.

    i agree with both Pepe and TMShucks. besides, if you convert values to text to have them overlap into the next cell, at some point you may want to "un-text" them, which would be an unnecessary, and possibley cumbersome task.

    Still a good tip though, but it needs to be used thoughtfully, thanks for sharing

    edit: and i forgot to mention I TOTALLY agree with the OP on not merging, and the headaches it can cause later
    Last edited by FDibbins; 11-03-2012 at 01:21 AM.
    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

  7. #7
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: TIP Don't merge if you don't have to.

    FDibbins,
    if you convert values to text ... at some point you may want to "un-text" them
    No, no, no! You don't convert them. It is about display. The value of the cell that looks like 3 Novenmber 2012 is still a number, same with totals fields as originally posted. And you can still do math.

    This is a tip for improving appearance and tidiness and ease of development and does not cause problems with lots of columns.

    see attached demo.overlaps.xls

  8. #8
    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,926

    Re: TIP Don't merge if you don't have to.

    seems to me you are?

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: TIP Don't merge if you don't have to.

    For anyone else who's watching the thread, a summary; the text function among other things allows a number (including a date) to be presented in a format that's wide than the column it is in (provided the adjacent tcell is empty. The cell value is still a number and can be used as such.
    How it 'seems' is not important. Sometimes it is useful.

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: TIP Don't merge if you don't have to.

    If you use TEXT you get text.

    In your example workbook the formula =ISTEXT(C1) returns TRUE.

    If you try and use C1 in a simple formula, eg =C1-10, you ge #VALUE!.

    Of course the original cell is still a number and can be used in calculations.

  11. #11
    Forum Contributor
    Join Date
    10-18-2012
    Location
    Telford, England
    MS-Off Ver
    Excel 2010 (2003)
    Posts
    294

    Re: TIP Don't merge if you don't have to.

    I was sure but i was wrong; I aplogise to all concerned and I'm grateful to those who pesisted to correct me.
    I added =Type(A1) etc in row 2 under the values and Yup, the =text does report 2 (text).

    In the instances where I've needed it, the figure has been final and without depenent calculations. So use with care if that does not apply to your situation.

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,371

    Re: TIP Don't merge if you don't have to.

    In the date example workbook, you demonstrate different ways of formatting the contents of cell A1, which contains a date. So, formatted as a number with 2 decimal places, formatted using TEXT and formatted as a long date with a custom format. Therefore, the "original" date exists in cell A1 and the format of that cell is unimportant. The other cells display the contents of cell A1 in different ways.

    You could, of course, say:
    =TEXT(41216,"ddd dd mmmm yyyy") or: =TEXT(DATEVALUE("03/11/2012"),"ddd dd mmmm yyyy") or even: =TEXT(DATE(2012,11,3),"ddd dd mmmm yyyy")

    They would all be pure text with no cell dependency. If you said: =SUM(C1), in your example, you would get 0.

    The SUM example in the OP is also an example of a text cell that "looks" as though it is a number. You can coerce it back to a number using "--" if you want to do arithmetic on it.

    I think we may be labouring this now. It was a reasonable suggestion for *displaying* a large numeric value or a long date in such a way that it can overlap into an adjacent cell. I think we have established that it has its drawbacks but it's potentially useful. We may or may not want to use it, but it is there if we want to.

    Regards, TMS

  13. #13
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: TIP Don't merge if you don't have to.

    It's definitely useful but only for display I would think.

  14. #14
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,371

    Re: TIP Don't merge if you don't have to.

    The cell value is still a number and can be used as such.
    The original cell is numeric but the displayed cell is not. You cannot directly use the cell in arithmetic but you can, as in the previous post, coerce the text value to a number.

    Regards, TMS

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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