PC Review


Reply
Thread Tools Rate Thread

Display currency as calculated

 
 
Zerowaycool
Guest
Posts: n/a
 
      7th May 2010
Gyus I am just about finished but I can't get Excel to display my currency as
the calculated result. I need to display this accurately so I can take the
figures to my accountant. My issue is that when I calculate the GST on an
amount, the calc is fine but is displayed in correctly eg $22.63 / 11 =
2.05727272727273, so I need it to display it as $2.05 not as it does - $2.06
(I am sure the taxman would like this printout). I looked at the TRUNC
command but can't get it to work.

Is there a way to do this in code to a column of numbers where every row has
been summed(horizontally), or is there another type of display style I should
use.

Thanks in advance

Gav
 
Reply With Quote
 
 
 
 
Wouter HM
Guest
Posts: n/a
 
      7th May 2010
Hi Gav,

You have to specify the number of digits remaining
Try:
=Trunc(22.63/11, 2)

HTH,

Wouter

 
Reply With Quote
 
Zerowaycool
Guest
Posts: n/a
 
      8th May 2010
Where I have a value like activecell.value = some long calculation or even a
sum of figues which end up equalling the answer of 22.63/11 how do I use the
Trunc function ? Do I need to have the activecell.value passed into a
variable and then call the variable into the trunc function. The reason is, I
have a loop running which calculates the activecell and then offsets.


"Wouter HM" wrote:

> Hi Gav,
>
> You have to specify the number of digits remaining
> Try:
> =Trunc(22.63/11, 2)
>
> HTH,
>
> Wouter
>
> .
>

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      8th May 2010
Maybe you could multiply by 100, take the integer part and then divide by 100.

Dim myVal As Double
myVal = 22.63 / 11
MsgBox Int(myVal * 100) / 100





Zerowaycool wrote:
>
> Gyus I am just about finished but I can't get Excel to display my currency as
> the calculated result. I need to display this accurately so I can take the
> figures to my accountant. My issue is that when I calculate the GST on an
> amount, the calc is fine but is displayed in correctly eg $22.63 / 11 =
> 2.05727272727273, so I need it to display it as $2.05 not as it does - $2.06
> (I am sure the taxman would like this printout). I looked at the TRUNC
> command but can't get it to work.
>
> Is there a way to do this in code to a column of numbers where every row has
> been summed(horizontally), or is there another type of display style I should
> use.
>
> Thanks in advance
>
> Gav


--

Dave Peterson
 
Reply With Quote
 
Zerowaycool
Guest
Posts: n/a
 
      8th May 2010
Thanks Dave that will do the job

"Dave Peterson" wrote:

> Maybe you could multiply by 100, take the integer part and then divide by 100.
>
> Dim myVal As Double
> myVal = 22.63 / 11
> MsgBox Int(myVal * 100) / 100
>
>
>
>
>
> Zerowaycool wrote:
> >
> > Gyus I am just about finished but I can't get Excel to display my currency as
> > the calculated result. I need to display this accurately so I can take the
> > figures to my accountant. My issue is that when I calculate the GST on an
> > amount, the calc is fine but is displayed in correctly eg $22.63 / 11 =
> > 2.05727272727273, so I need it to display it as $2.05 not as it does - $2.06
> > (I am sure the taxman would like this printout). I looked at the TRUNC
> > command but can't get it to work.
> >
> > Is there a way to do this in code to a column of numbers where every row has
> > been summed(horizontally), or is there another type of display style I should
> > use.
> >
> > Thanks in advance
> >
> > Gav

>
> --
>
> Dave Peterson
> .
>

 
Reply With Quote
 
Dana DeLouis
Guest
Posts: n/a
 
      9th May 2010
On 5/7/2010 12:00 PM, Zerowaycool wrote:
> Gyus I am just about finished but I can't get Excel to display my currency as
> the calculated result. I need to display this accurately so I can take the
> figures to my accountant. My issue is that when I calculate the GST on an
> amount, the calc is fine but is displayed in correctly eg $22.63 / 11 =
> 2.05727272727273, so I need it to display it as $2.05 not as it does - $2.06
> (I am sure the taxman would like this printout). I looked at the TRUNC
> command but can't get it to work.
>
> Is there a way to do this in code to a column of numbers where every row has
> been summed(horizontally), or is there another type of display style I should
> use.
>
> Thanks in advance
>
> Gav


> $22.63 / 11



Hi. Just two cents for consideration.
When one introduces division with currency values, I think one must be
aware of a question. For example: do you want to consider 1.4999999999
as exactly 1.50 ? I think this is important for Rounding Up and Down.
If one considered the above number as 1.50, then there would be no need
to round down to the nearest 2 decimal places.
Again, just something to consider. :>)

Sub Demo()
Dim c As Currency
Dim n, y

'// A division w/ financial numbers
n = 149999999999# / 100000000000#
y = WorksheetFunction.Floor(n, 0.01)
Debug.Print y

'// Rounding w/ Currency
c = 149999999999# / 100000000000#
y = WorksheetFunction.Floor(c, 0.01)
Debug.Print y
End Sub

Returns:
1.49
1.5

= = = = = = =
HTH :>)
Dana DeLouis
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
calculated currency field sorts like text instead of numeric Paul Microsoft Access Forms 4 24th Jun 2009 02:38 AM
calculated currency field sorts like text instead of numeric Paul Microsoft Access Queries 4 24th Jun 2009 02:38 AM
Why can I not format a calculated field in a query to Currency? =?Utf-8?B?Q1NPVVNB?= Microsoft Access Queries 3 22nd Mar 2006 06:02 PM
Return Number In Calculated Field as Currency joshbell@gmail.com Microsoft Access Queries 2 12th Dec 2005 10:39 PM
Calculated currency field (increase percentage) John Chiurato Microsoft Access Queries 2 10th Sep 2003 06:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:24 PM.