+ Reply to Thread
Results 1 to 9 of 9

Maintaining fractional formatting when combining cells

  1. #1
    Registered User
    Join Date
    07-15-2007
    Posts
    19

    Maintaining fractional formatting when combining cells

    Hi,

    I want to combine 2 different columns with formatted information.

    The first column contains measurements in millimeters(e.g. 15mm). The 2nd column has measurements formatted to fractions (e.g. 5/8). The measurements in the second column are inches.

    When I try to combine using the "&":

    Please Login or Register  to view this content.
    The result is:

    Please Login or Register  to view this content.
    So when I try to combine it turns my fractional formatting into decimals. Is there a way around this.



    I also want to add inverted commas after the inches measurement (eg 5/8"). Is there a way to do this. I've try combining the inches measurement like this:

    Please Login or Register  to view this content.
    But that doesn't work. Excel just gives me errors.

    Any suggestions anyone? I have over 400 of these measurements so I don't really feel like doing it by hand.

    Thanks

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    To format cells as mm,

    Format > Cells > Mumber, Custom General"mm" or 0.0"mm", or ...

    To format as fractions like 2 1/8", use format

    # ?/?"''" (that's a double quote, two single quotes, and a double quote)

  3. #3
    Registered User
    Join Date
    07-15-2007
    Posts
    19
    Quote Originally Posted by shg View Post
    To format cells as mm,

    Format > Cells > Mumber, Custom General"mm" or 0.0"mm", or ...
    Thanks but my cells are already text entries as millimeters


    To format as fractions like 2 1/8", use format

    # ?/?"''" (that's a double quote, two single quotes, and a double quote)
    I tried this and this works Thanks, that's one part of the problem solved.

    The next part is that I want to combine the millimeters measurement and the inches in the one cell but excel ignores my fractional formatting when I combine using "&" and converts the inches fraction back to a decimal fraction. So the result is:

    23mm 0.625

    Where as I want:

    23mm 5/8"

    Any ideas?

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    =A1&"mm"&" "&TEXT(B1,"# ?/?")&""""
    Last edited by martindwilson; 09-16-2008 at 03:11 AM.

  5. #5
    Registered User
    Join Date
    07-15-2007
    Posts
    19
    Quote Originally Posted by martindwilson View Post
    =A1&"mm"&" "&TEXT(B1,"# ?/?")&""""
    Thanks so much for that. That's brilliant!

  6. #6
    Registered User
    Join Date
    07-15-2007
    Posts
    19
    Hi,

    I've tested this formula further:

    Please Login or Register  to view this content.
    It works fine except when the converted millimetres is a whole number which is under 10 inches. E.g. if I convert 25mm to inches the resulting formatting is:

    50mm (2 ")

    Where as I want it to look like the example below without the extra spacing between the " and the 2:

    50mm (2")


    It works fine if the number in inches is a fraction e.g. 2 5/8"
    Or if the number is greater or equal to 10".

    Any suggestions how to fix this formatting. Thanks

  7. #7
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    =A1 & "mm " & TEXT(B1, IF(B1 = INT(B1), "0", "# ?/?") ) & """"

  8. #8
    Registered User
    Join Date
    07-15-2007
    Posts
    19
    Quote Originally Posted by shg View Post
    =A1 & "mm " & TEXT(B1, IF(B1 = INT(B1), "0", "# ?/?") ) & """"
    Great! Thanks.

    So how does this if statement work?

    Please Login or Register  to view this content.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    How about you look at Help for IF and INT, and I'll explain anything that isn't clear after that?

+ 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. Formatting Cells - Width
    By drurjs2344 in forum Excel General
    Replies: 4
    Last Post: 09-15-2008, 02:15 PM
  2. Conditional Formatting multiple cells
    By mc515 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-04-2008, 06:10 AM
  3. Retaining Formatting in Filtered Cells
    By JamesShepherd in forum Excel General
    Replies: 0
    Last Post: 12-06-2006, 12:17 PM
  4. Replies: 6
    Last Post: 11-22-2006, 02:09 PM
  5. Need to link formatting of cells within the same worksheet
    By Fartnuckles in forum Excel General
    Replies: 5
    Last Post: 10-03-2006, 03:52 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