Announcement Banner
UNSOLVED

Rut

updated

22 years ago

R

Rut

1 Rookie

•

72 Posts

0

7680

December 2nd, 2004 22:00

Excel postdecimal digits.

I'm an old hand at Excel but have the following problem I am unable to solve. Will describe by example.
 
Value in cell A1 is the sum of several other cells, is defined by name TONPRICE, and is formatted as currency with no postdecimal digits. For example, it may read "$26".
 
Cell C20 contain text that includes the TONPRICE contents of cell A1. For example, it may supposed to read "At $26". The actual formula in cell C20 is: ="At $"&TONPRICE. Cell C20 is also formatted as currency with no postdecimal digits.
 
Sometimes the output from this is correct, as "At $26".
 
But sometimes the output is incorrect in that it contains numerous postdecimal digits, as "At $25.8760432108".
 
I have tried everything I can think of but am unable to fix the incorrect output.
 
Any ideas would be appreciated.
 
Rut
  • abach

    1728 Posts

    239

    0

    Posted December 3rd, 2004 01:00

    First, use your Range name as the cell formula. Then choose Format, Cell, Custom and type the following in the Type":

    "At " $#,##0

    This will display the cell with the calculated value in the TONPRICE with the word At and format it to currency with no decimals.
     
    In your example, cell C20 will have =TONPRICE as the formula with the above cell format
  • knoxtenor

    15 Posts

    239

    0

    Posted December 3rd, 2004 01:00

    Rut, you'll need to modify the formula in cell C20 thus:

     

    ="At $" & ROUND(TONPRICE,0)

    Despite the displayed value in cell A1 (i.e., TONPRICE), the actual value may not be a whole number.  Hence, when you use TONPRICE in cell C20, you get the actual value of TONPRICE.  Adding the "round" command forces Excel to round the actual to zero decimal places.

    knoxtenor

  • Rut

    1 Rookie

    •

    72 Posts

    239

    0

    Posted December 3rd, 2004 15:00

    Thanks to both of you.
     
    I tried both of these solutions, and both work. The one I think I'll use is ="At $" & ROUND(TONPRICE,0), because many times I'm plugging named numbers into lengthy sentences.
     
    I still can't figure out, for the life of me, why ="At $"&TONPRICE by itself works on one worksheet, does not work on another, and does sometimes and does not other times work on duplicates of either worksheet. It's a mistery!
     
    Thanks again,
    Rut