+ Reply to Thread
Results 1 to 2 of 2

Using the "&" to stick text and values together; How to round the numbers?

  1. #1
    Registered User
    Join Date
    01-04-2004
    Location
    Netherlands
    Posts
    54

    Using the "&" to stick text and values together; How to round the numbers?

    Hey all,

    My current excel sheet has to output data used in another computer program. Using the & option, I can combine text and numbers into something like this in cell A1:

    ="Inertia=("&(X12*F26)+X9&","&(X11*F27)+X8&","&(X13*F28)+X10&")"

    which looks like this:

    Inertia=(2025.19711536,2106.86410710667,362.510333333333)

    But regardless of the cell properties of A1 or the value cells (X12, F26 etc), it always uses lots of decimal places. Changing the cell properties to one or two digits doesn't change this. It is not a HUGE problem but I'd much rather have that line look like this:

    Inertia=(2025.2,2106.9,362.5)

    Is there a way to do that or will I just have to live with it? Even when I use the ROUND function in the X12, F26 cells, it will still use lots of decimal places.. Edit: that is not true, using round in the cells where I pick the data from does work... I would prefer that the cell properties just worked though..
    Hope to learn some more Excel from this!

    /Niels
    Last edited by niels007; 02-25-2008 at 12:09 PM.

  2. #2
    Forum Contributor EdMac's Avatar
    Join Date
    01-23-2006
    Location
    Exeter, UK
    MS-Off Ver
    2003
    Posts
    1,264
    Niels

    Please Login or Register  to view this content.
    You need to use the ROUND function in each part of the expression

    e.g. &Round(X12*F26,2)+etc

    It's the only way to do it unless the data is rounded at source to eliminate the decimal places - 2 dp*2 dp = 4dp so the number of dps increases

    What you are doing is producing a text string so the cell formatting does not work.

    Ed





    Ed

+ 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