+ Reply to Thread
Results 1 to 3 of 3

Retaining formatting in concatenate

  1. #1
    Registered User
    Join Date
    12-28-2010
    Location
    Atlanta, GA
    MS-Off Ver
    2003 and 2010
    Posts
    27

    Retaining formatting in concatenate

    Hey everyone,
    I have a weird situation. There is a chart, then I write a sentence below it for each week, summarizing data points. It's not hard, but very time consuming, seeing as how I have usually 10-15 charts/week and two summaries per chart. So I wrote out some code to concatenate text and data, but it won't retain formatting. Date values come through as the Excel Date Value, percentages come through as decimals, and large numbers do not include commas. Is there a way to do this?

    I have attached an example, as well as some really ugly code I wrote to manually format it. Is there a simple command to just format Number with comma, Percent, etc?

    Thanks!
    Attached Files Attached Files
    Last edited by RussellNonBrand; 06-08-2011 at 05:31 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Retaining formatting in concatenate

    You can use a mixture of TEXT function (to dictate the number format for dates and/or percentages) or FIXED function which fixes decimal places for a number (and by default shows comma separators), e.g. try

    =CONCATENATE("> The number of opened emails for ",TEXT(B7,"m/d")," was ",FIXED(J7,0)," with an open rate of ",TEXT(K7,"0.00%")," which is ",IF(K7>K8,"higher","lower")," than the average open rate from the past ",COUNT(C2:C7)," weeks.")
    Audere est facere

  3. #3
    Registered User
    Join Date
    12-28-2010
    Location
    Atlanta, GA
    MS-Off Ver
    2003 and 2010
    Posts
    27

    Re: Retaining formatting in concatenate

    That is so much prettier than the cobbled together mess of a code I had written, haha. Thank you!

+ 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