Comments on: Excel Help - How to Concatenate without all the extra decimals??
http://ask.metafilter.com/309135/Excel-Help-How-to-Concatenate-without-all-the-extra-decimals/
Comments on Ask MetaFilter post Excel Help - How to Concatenate without all the extra decimals??Fri, 19 May 2017 08:13:37 -0800Fri, 19 May 2017 08:18:35 -0800en-ushttp://blogs.law.harvard.edu/tech/rss60Question: Excel Help - How to Concatenate without all the extra decimals??
http://ask.metafilter.com/309135/Excel-Help-How-to-Concatenate-without-all-the-extra-decimals
I'm working on a sheet where I have a summary box explaining the data in the spread sheet. Something like "With 80 guests per day and and average transaction size of $14.32, you can expect 61% margins. Concatenation is not working the way I hoped =/ <br /><br /> For arguments sake, "80 is referencing A1, $14.32 is referencing B1, and 61% is referencing C1<br>
<br>
The concatenation formula works and is pulling the correct number. However, I have the cells set to decrease the decimal so it is showing whole numbers, even though the true value of A1 is 79.98431<br>
<br>
What I need is the accuracy of the decimals, but the formula to return the value "80" in the concatenation formula so it doesn't say "With 79.98431 guests per day and average transaction size of $14.32034178, you can expect margins of 61.32%.<br>
<br>
Any thoughts? thanks!post:ask.metafilter.com,2017:site.309135Fri, 19 May 2017 08:13:37 -0800FireStyleexcelspreadsheetformatformulamicrosoftcomputerpcbusinessconcatenationBy: adamrice
http://ask.metafilter.com/309135/Excel-Help-How-to-Concatenate-without-all-the-extra-decimals#4472101
=CONCATENATE("With", ROUND(A1,0), "guests per day and an average transaction size of", ROUND(B1,2), ", you can expect margins of ", ROUND(C1,0))comment:ask.metafilter.com,2017:site.309135-4472101Fri, 19 May 2017 08:18:35 -0800adamriceBy: zamboni
http://ask.metafilter.com/309135/Excel-Help-How-to-Concatenate-without-all-the-extra-decimals#4472102
The rounding you're doing in the cells is a matter of formatting - you're not actually changing the value, so when you concatenate, it uses the original value. Maybe try using <a href="https://support.office.com/en-us/article/ROUND-function-c018c5d8-40fb-4053-90b1-b3e7f61a213c">ROUND(number, num_digits)</a> on the values in your formula?comment:ask.metafilter.com,2017:site.309135-4472102Fri, 19 May 2017 08:18:55 -0800zamboniBy: DevilsAdvocate
http://ask.metafilter.com/309135/Excel-Help-How-to-Concatenate-without-all-the-extra-decimals#4472103
You want the TEXT function, which allows you to represent a value as text in a given format.<br>
<br>
<code>="With "&TEXT(A1,"0")&" guests per day and average transaction size of "&TEXT(B1,"$0.00")&", you can expect margins of "&TEXT(C1,"0%")&"."</code>comment:ask.metafilter.com,2017:site.309135-4472103Fri, 19 May 2017 08:19:15 -0800DevilsAdvocateBy: a good beginning
http://ask.metafilter.com/309135/Excel-Help-How-to-Concatenate-without-all-the-extra-decimals#4472105
Ha, beat to it. <small>ROUND(number, num_digits)</small> works by asking for your reference point, then the number of digits you'd like to round the variable to, splitting at .49 repeating <small>&</small> .5. In fact, in your use case, you might be well-served to use a <small>RoundUp()</small> formula for your guests, as it operates in the same way as a <small>Round()</small> does, but does this sort of behavior to roll up to the next integer:<br>
<br>
> whereas 79 guests precise – <small>ROUNDUP(79.0,0)</small> – will "round up" to 79, <br>
> 79.1 guests – <small>ROUNDUP(79.1,0)</small> – will round straight up to 80.<br>
<br>
And, this may be common sense, but be advised that you can of course nest this formula in place of any variable.<br>
For example, if you reference cell A1, it's valid if you replace <small>=CONCATENATE(A1,...)</small> with <small>CONCATENATE(ROUND(A1,0),...)</small>.</small></small>comment:ask.metafilter.com,2017:site.309135-4472105Fri, 19 May 2017 08:30:06 -0800a good beginningBy: FireStyle
http://ask.metafilter.com/309135/Excel-Help-How-to-Concatenate-without-all-the-extra-decimals#4472115
@DevilsAdvocate - that did the trick! @ a good beginning, adamrice, and zamboni - that's how I had it before, but the rounding was creating errors that became exponentially worse as the input values increased.<br>
<br>
Thanks for the help!comment:ask.metafilter.com,2017:site.309135-4472115Fri, 19 May 2017 08:58:23 -0800FireStyle