+ Reply to Thread
Results 1 to 12 of 12

adding a cell in a text string

  1. #1
    Registered User
    Join Date
    08-10-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2013
    Posts
    20

    adding a cell in a text string

    I was able to find the syntax to add a cell within a text string but I am having a formatting problem. The cells which I am adding were using formulas that left decimals. Although I turned off all of the decimals on the cell, the values when I used the cell within the text string included all of the decimals and in some cases 6 or more decimal places. Is there a way to keep the formatting of the cell?

    Thanks in advance.
    Last edited by seemore; 08-11-2009 at 11:43 AM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: adding a cell in a text string

    I assume you have something like
    Please Login or Register  to view this content.
    You need to use the TEXT Function like so
    Please Login or Register  to view this content.
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    08-10-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2013
    Posts
    20

    Re: adding a cell in a text string

    I'm not very good at this and it didn't work for me but i'm not sure i am following it correctly. The string that I wrote initially was "the answer is "&Sheet3!L18&"." I added the word text like you had it but I got an error.

  4. #4
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: adding a cell in a text string

    Hi,

    May be this

    ="the answer is "&ROUND(Sheet3!L18,0)&"."
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  5. #5
    Registered User
    Join Date
    08-10-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2013
    Posts
    20

    Re: adding a cell in a text string

    That worked pefectly. I feel like I'm addicted now and I want more. If possible, I would like the number to show as currency and with commas. I figured out a way to get the $ sign there by just adding it as text in front of the formula so that isn't a big one, but how can I do the comma?

    Thanks again.

  6. #6
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: adding a cell in a text string

    Hi,

    No need to add the $ sign, all you need to do is select the cell, right click, Format, Number, Currency

  7. #7
    Registered User
    Join Date
    08-10-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2013
    Posts
    20

    Re: adding a cell in a text string

    I had the cells already formatted as currency with $ and no decimals. I would have thought that that would have worked also and when it didn't, I simply added in the $ in the text.

  8. #8
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: adding a cell in a text string

    Hi,

    Sorry my mistake, forgot it was a text cell, so try

    ="the answer is $"&TEXT(ROUND(Sheet3!L18,0),"#,000")&"."

    (Do you really need the decimal point at the end?)

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: adding a cell in a text string

    Your post does not comply with Rule 8 of our Forum RULES. Cross-posting is when you post the same question in other forums on the web. You'll find people are disinclined to respond to cross-posts because they may be wasting their time solving a problem that has been solved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser)to the cross-post. Expect cross-posts without a link to be closed a message will be posted by the moderator explaining why. We are here to help so help us help you!

    http://www.thecodecage.com/forumz/ex...xt-string.html
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  10. #10
    Registered User
    Join Date
    08-10-2009
    Location
    U.S.
    MS-Off Ver
    Excel 2013
    Posts
    20

    Re: adding a cell in a text string

    Wow, that is a lot of formulas but it worked perfectly. The decimal at the end was really a period for the end of the sentence. Thanks a bunch you were a great help. Inadvertently I think I figured out my $ issue. I accidently hit the $ when putting in "$#,000" and now I have commas and a $. Again many, many thanks.

  11. #11
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: adding a cell in a text string

    Thanks for taking the time to read and comply with the rule .

  12. #12
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097

    Re: adding a cell in a text string

    Hi,

    Just for the record a slightly shorter version would do, that adds the comma and rounds to thousands

    ="The answer is $"&FIXED(Sheet3!L18,0)&"."

+ 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