Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 59
Default Round up or down by set variable

Is there a way to have a number round up or down based on a threshhold it
hits between the two number? I want a number when it hits .8 to round up,
otherwise round down.

For example 1.8 would round up to 2 but 1.79 would round down to 1
2.8 would round up to 3 but 2.79 would round down to 2, etc.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 457
Default Round up or down by set variable

=IF(MOD(A2,1)<0.8,ROUNDDOWN(A2,0),ROUNDUP(A2,0))

--
Best Regards,

Luke M
"Supe" wrote in message
...
Is there a way to have a number round up or down based on a threshhold it
hits between the two number? I want a number when it hits .8 to round up,
otherwise round down.

For example 1.8 would round up to 2 but 1.79 would round down to 1
2.8 would round up to 3 but 2.79 would round down to 2, etc.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Round up or down by set variable

Hi,

One way

=IF(MOD(A1,1)=0.8,CEILING(A1,1),INT(A1))
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Supe" wrote:

Is there a way to have a number round up or down based on a threshhold it
hits between the two number? I want a number when it hits .8 to round up,
otherwise round down.

For example 1.8 would round up to 2 but 1.79 would round down to 1
2.8 would round up to 3 but 2.79 would round down to 2, etc.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 905
Default Round up or down by set variable

"Supe" wrote in message
...
I want a number when it hits .8 to round up,
otherwise round down.

[....]
For example 1.8 would round up to 2 but
1.79 would round down to 1


Ostensibly:

=rounddown(A1,0) + (mod(A1,1)=0.8)

But that would round 1.795 down to 1, even though it might display as 1.80
(Number with 2 dp). So I wonder if you would be happier with:

=rounddown(A1,0) + (round(mod(A1,1),2)=0.8)


----- original message -----

"Supe" wrote in message
...
Is there a way to have a number round up or down based on a threshhold it
hits between the two number? I want a number when it hits .8 to round up,
otherwise round down.

For example 1.8 would round up to 2 but 1.79 would round down to 1
2.8 would round up to 3 but 2.79 would round down to 2, etc.


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
Runtime Error '91' Object variable or With block variable not set Alec Coliver Excel Discussion (Misc queries) 2 October 24th 09 02:29 PM
variable height variable width stacked bar charts ambthiru Charts and Charting in Excel 3 January 18th 06 11:41 PM
Sum cells based on a row variable and seperate column variable CheeseHeadTransplant Excel Worksheet Functions 10 September 23rd 05 06:59 PM
why is it saying sheetcnt is "variable not defined" how to do a global variable to share over multiple functions in vba for excel? Daniel Excel Worksheet Functions 1 July 9th 05 03:05 AM
How do I ROUND() round off decimals of a column dataset? Højrup Excel Worksheet Functions 2 January 12th 05 10:50 AM


All times are GMT +1. The time now is 09:48 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"