View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Seemore Seemore is offline
external usenet poster
 
Posts: 19
Default adding a cell in a text string

On Aug 11, 10:42*am, Ron Rosenfeld wrote:
On Tue, 11 Aug 2009 06:23:18 -0700
wrote:

The string that i used is ="If you pay $Sheet3!$J$5&" over 15 years,
you will have paid a total of $"&Sheet3!L18&"." * *The first cell
gives me 2 decimals and the second gives me 9. *I would prefer whole
numbers instead. *I appreciate the help and will also seek the help of
the other group you mentioned.


You have to do the formatting within the text statement.

You probably want something like:

="If you pay "&TEXT(Sheet3!$J$5,"$#,##0")
&" over 15 years, you will have paid a total of "&
TEXT(Sheet3!L18,"$#,##0.")

The above formatting assumed you wanted zero decimal places, $ formatting
(select your own currency symbol if '$' is not appropriate), and that there was
nothing special to do about negative values.
--ron


That worked perfectly. In the future, if I decide I want decimals how
would I change it? Again, many thanks. These forums have saved me a
lot of headaches.