Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Rounddown problem in VBA

Hie, i have problem rounding down a value using VBA. Can you help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Rounddown problem in VBA

rounding down a number to the integer
<rounded down=INT(number)

rounding down a number and rounding up a negative
<rounded down=INT(number+SGN(number)/2-0.5)

rounding to somethign other than an integer
<rounded down to 1dp=INT(number*10)/10

using round function
<rounded down=application.round(......)

application.command(...) accesses the excel formulae





-----Original Message-----
Hie, i have problem rounding down a value using VBA. Can

you help?
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Rounddown problem in VBA

(chiajack) wrote in message . com...
Hie, i have problem rounding down a value using VBA. Can you help?


Have you tryed the =FLOOR() formula?
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Rounddown problem in VBA

There's a problem with your 2nd formula. If Number = -3892.1, it gives -3894. If Number = 0, the
result is -1.

To round a positive number down and a negative number up, you can use FIX, i.e.

=FIX(Number)

You can also use the worksheet functions ROUNDUP and ROUNDDOWN, as well as ROUND.

With Number = -3892.1, Fix, Round, and RoundDown all give -3892. RoundUp gives -3893.


On Tue, 28 Oct 2003 03:42:09 -0800, "Jeminar" wrote:

rounding down a number to the integer
<rounded down=INT(number)

rounding down a number and rounding up a negative
<rounded down=INT(number+SGN(number)/2-0.5)

rounding to somethign other than an integer
<rounded down to 1dp=INT(number*10)/10

using round function
<rounded down=application.round(......)

application.command(...) accesses the excel formulae





-----Original Message-----
Hie, i have problem rounding down a value using VBA. Can

you help?
.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Rounddown problem in VBA

you can use the worksheet functions:

? Application.RoundDown(1.238,2)
1.23

? Application.Floor(1.238, 0.005)
1.235



In article ,
(chiajack) wrote:

Hie, i have problem rounding down a value using VBA. Can you help?

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
ROUNDDOWN Dan Hoffman New Users to Excel 3 November 4th 09 09:08 PM
Rounddown Dates Micki Excel Discussion (Misc queries) 2 October 24th 07 03:56 PM
Using ROUNDDOWN - Help please BritRaider Excel Discussion (Misc queries) 3 August 21st 07 04:58 PM
rounddown jnf Excel Worksheet Functions 5 March 17th 06 01:16 PM
Rounddown problem... nekteo via OfficeKB.com Excel Discussion (Misc queries) 3 January 14th 06 11:36 PM


All times are GMT +1. The time now is 05:32 PM.

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"