Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Display currency as calculated

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Display currency as calculated

Hi Gav,

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

HTH,

Wouter

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Display currency as calculated

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

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Display currency as calculated

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
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Display currency as calculated

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
.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 690
Default Display currency as calculated

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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I display a loss or gain (currency) brewster56 Excel Worksheet Functions 5 November 26th 08 07:41 PM
change a currency number display wilywayne Excel Discussion (Misc queries) 4 August 3rd 06 02:55 PM
Display Value in 'Currency Format' mpeplow[_3_] Excel Programming 3 June 15th 06 01:13 PM
Failure to display currency format SWAN_943 Excel Discussion (Misc queries) 2 October 2nd 05 03:00 PM
Formatting a text box to display as currency Ed P Excel Worksheet Functions 1 April 12th 05 01:34 AM


All times are GMT +1. The time now is 02:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"