<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: The Currency Format</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2009/10/08/the-currency-format/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2009/10/08/the-currency-format/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 23:42:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Bill Benson</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/08/the-currency-format/#comment-41873</link>
		<dc:creator>Bill Benson</dc:creator>
		<pubDate>Wed, 28 Oct 2009 16:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3100#comment-41873</guid>
		<description>&lt;p&gt;Niek,&lt;/p&gt;
&lt;p&gt;With data type = Currency, you can really mess up the user&#039;s data. For example&lt;br&gt;
Selection.Value  = Selection.Value + 5&lt;/p&gt;
&lt;p&gt;The data feeding the calculation (as we now know) gets truncated according to the number of decimals being displayed.&lt;/p&gt;
&lt;p&gt;Stuffing this into the default property of the Range object forces the result to be based on the truncated value. Yikes.&lt;/p&gt;
&lt;p&gt;I agree with Charles and now know that I HAVE TO start using .Value2&lt;/p&gt;
&lt;p&gt;Even if I do not format things as Currency, the user might. Naughty user.&lt;/p&gt;
&lt;p&gt;Good post Dick.&lt;/p&gt;
&lt;p&gt;Bill&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Niek,</p>
<p>With data type = Currency, you can really mess up the user&#8217;s data. For example<br />
Selection.Value  = Selection.Value + 5</p>
<p>The data feeding the calculation (as we now know) gets truncated according to the number of decimals being displayed.</p>
<p>Stuffing this into the default property of the Range object forces the result to be based on the truncated value. Yikes.</p>
<p>I agree with Charles and now know that I HAVE TO start using .Value2</p>
<p>Even if I do not format things as Currency, the user might. Naughty user.</p>
<p>Good post Dick.</p>
<p>Bill</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Williams</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/08/the-currency-format/#comment-41651</link>
		<dc:creator>Charles Williams</dc:creator>
		<pubDate>Wed, 14 Oct 2009 16:17:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3100#comment-41651</guid>
		<description>&lt;p&gt;Dick,&lt;/p&gt;
&lt;p&gt;The Excel Calculation engine always works in floating point. Excel itself only holds internally one type of number (double precision floating point). In Excel&#039;s presentation layer you see the formatted values as Dates, currencies etc, but how you format a value does not affect Excel&#039;s internal underlying value (apart from Precision as Displayed of course).&lt;/p&gt;
&lt;p&gt;So personally I think its a bug that var=Range.Value converts Excel&#039;s double to a VBA Currency datatype if the cell is formatted as currency, because the values get truncated and you cannot consistently round-trip a value from Excel to VBA and back to Excel: I cannot see any circumstance where this conversion is a good thing.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Dick,</p>
<p>The Excel Calculation engine always works in floating point. Excel itself only holds internally one type of number (double precision floating point). In Excel&#8217;s presentation layer you see the formatted values as Dates, currencies etc, but how you format a value does not affect Excel&#8217;s internal underlying value (apart from Precision as Displayed of course).</p>
<p>So personally I think its a bug that var=Range.Value converts Excel&#8217;s double to a VBA Currency datatype if the cell is formatted as currency, because the values get truncated and you cannot consistently round-trip a value from Excel to VBA and back to Excel: I cannot see any circumstance where this conversion is a good thing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick Kusleika</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/08/the-currency-format/#comment-41635</link>
		<dc:creator>Dick Kusleika</dc:creator>
		<pubDate>Tue, 13 Oct 2009 20:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3100#comment-41635</guid>
		<description>&lt;p&gt;Charles, are you saying that typename(.Value) returning Currency is not right?  Or that when you read the value into VBA it&#039;s caste as Currency, but the calculation engine always uses the floating point number?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Charles, are you saying that typename(.Value) returning Currency is not right?  Or that when you read the value into VBA it&#8217;s caste as Currency, but the calculation engine always uses the floating point number?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Williams</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/08/the-currency-format/#comment-41631</link>
		<dc:creator>Charles Williams</dc:creator>
		<pubDate>Tue, 13 Oct 2009 17:45:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3100#comment-41631</guid>
		<description>&lt;p&gt;Doug,&lt;/p&gt;
&lt;p&gt;There is no equivalent to the currency datatype in the spreadsheet, values formatted as currency are still floating point doubles in Excel.&lt;/p&gt;
&lt;p&gt;My personal guess is that this was a bug in the original design of Excel VBA, but by the time MS discovered it the bug had already escaped into the wild so that the only way of fixing it without breaking backwards compatibility was by adding .Value2&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Doug,</p>
<p>There is no equivalent to the currency datatype in the spreadsheet, values formatted as currency are still floating point doubles in Excel.</p>
<p>My personal guess is that this was a bug in the original design of Excel VBA, but by the time MS discovered it the bug had already escaped into the wild so that the only way of fixing it without breaking backwards compatibility was by adding .Value2</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niek Otten</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/08/the-currency-format/#comment-41630</link>
		<dc:creator>Niek Otten</dc:creator>
		<pubDate>Tue, 13 Oct 2009 17:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3100#comment-41630</guid>
		<description>&lt;p&gt;Doug,&lt;/p&gt;
&lt;p&gt;4 Decimals: maybe because exchange rates (which are prices too) are often in 4 decimals&lt;/p&gt;
&lt;p&gt;Niek Otten&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Doug,</p>
<p>4 Decimals: maybe because exchange rates (which are prices too) are often in 4 decimals</p>
<p>Niek Otten</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Doug Jenkins</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/08/the-currency-format/#comment-41614</link>
		<dc:creator>Doug Jenkins</dc:creator>
		<pubDate>Tue, 13 Oct 2009 03:41:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3100#comment-41614</guid>
		<description>&lt;p&gt;Does anyone know the logic for this?&lt;/p&gt;
&lt;p&gt;Having the currency data type behaving differently in the spreadsheet and in VBA, and having 4 decimal places, rather than 2?&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Does anyone know the logic for this?</p>
<p>Having the currency data type behaving differently in the spreadsheet and in VBA, and having 4 decimal places, rather than 2?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Niek Otten</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/08/the-currency-format/#comment-41610</link>
		<dc:creator>Niek Otten</dc:creator>
		<pubDate>Mon, 12 Oct 2009 21:23:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3100#comment-41610</guid>
		<description>&lt;p&gt;The .Value property in VBA may give only 4 decimals, but the value used in worksheet calculations still has all the decimals.&lt;/p&gt;
&lt;p&gt;Niek Otten&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The .Value property in VBA may give only 4 decimals, but the value used in worksheet calculations still has all the decimals.</p>
<p>Niek Otten</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Charles Williams</title>
		<link>http://www.dailydoseofexcel.com/archives/2009/10/08/the-currency-format/#comment-41569</link>
		<dc:creator>Charles Williams</dc:creator>
		<pubDate>Fri, 09 Oct 2009 09:53:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=3100#comment-41569</guid>
		<description>&lt;p&gt;If you use .Value with a cell formatted as currency the value will be converted to Currency datatype by VBA.&lt;br&gt;
Of course you probably won&#039;t see this because most of the time you imeditaley do some other VBA operation (like arithmetic) that converts it from currency to Double.&lt;/p&gt;
&lt;p&gt;.Value2 is faster than .Value and avoids this under-the-covers currency truncation: there is no good reason to ever use .Value apart from laziness (its the defaulr .Range property)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>If you use .Value with a cell formatted as currency the value will be converted to Currency datatype by VBA.<br />
Of course you probably won&#8217;t see this because most of the time you imeditaley do some other VBA operation (like arithmetic) that converts it from currency to Double.</p>
<p>.Value2 is faster than .Value and avoids this under-the-covers currency truncation: there is no good reason to ever use .Value apart from laziness (its the defaulr .Range property)</p>
]]></content:encoded>
	</item>
</channel>
</rss>

