#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 63
Default Round Function

I am using Excel 2007 and need some helping on a rounding formula. I would
like my cell to either round to the nearest whole num or ".5" of the number
but it needs to round down. For example:

5.1 would round to 5.0
5.4 would round to 5.0
5.5 would round to 5.5
5.7 would round to 5.5
5.9 would round to 5.5
6.0 would round to 6.0

I am using the Mround function but that rounds up so 5.8 and 5.9 rounds to
6.0 but I need them both to round to 5.5.

Any thoughts? Thanks!

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 63
Default Round Function

I think I may have got it: =ROUNDDOWN(A1/0.5,0)*0.5

"duketter" wrote:

I am using Excel 2007 and need some helping on a rounding formula. I would
like my cell to either round to the nearest whole num or ".5" of the number
but it needs to round down. For example:

5.1 would round to 5.0
5.4 would round to 5.0
5.5 would round to 5.5
5.7 would round to 5.5
5.9 would round to 5.5
6.0 would round to 6.0

I am using the Mround function but that rounds up so 5.8 and 5.9 rounds to
6.0 but I need them both to round to 5.5.

Any thoughts? Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 50
Default Round Function

This may not be the prettiest way but it works.
=IF(A1-INT(A1)=0.5,INT(A1)+0.5,INT(A1))

"duketter" wrote:

I am using Excel 2007 and need some helping on a rounding formula. I would
like my cell to either round to the nearest whole num or ".5" of the number
but it needs to round down. For example:

5.1 would round to 5.0
5.4 would round to 5.0
5.5 would round to 5.5
5.7 would round to 5.5
5.9 would round to 5.5
6.0 would round to 6.0

I am using the Mround function but that rounds up so 5.8 and 5.9 rounds to
6.0 but I need them both to round to 5.5.

Any thoughts? Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Round Function

Hi.

Try this

=FLOOR(A1,0.5)

--
Mike

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


"duketter" wrote:

I am using Excel 2007 and need some helping on a rounding formula. I would
like my cell to either round to the nearest whole num or ".5" of the number
but it needs to round down. For example:

5.1 would round to 5.0
5.4 would round to 5.0
5.5 would round to 5.5
5.7 would round to 5.5
5.9 would round to 5.5
6.0 would round to 6.0

I am using the Mround function but that rounds up so 5.8 and 5.9 rounds to
6.0 but I need them both to round to 5.5.

Any thoughts? Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 905
Default Round Function

"duketter" wrote:
I would like my cell to either round to the nearest
whole num or ".5" of the number but it needs to
round down.


Ostensibly, you want to round down to the nearest 0.5. Try:

=ROUNDDOWN(A1*2,0)/2

Caveat: "what you see is NOT what you get" always. For example, if A1 is
formatted as Number with 1 decimal place, and the value is 5.95, you will see
6.0, but the ROUNDDOWN expression above will result in 5.5. If that is
unacceptable, then perhaps you want:

=ROUNDDOWN(ROUND(A1,1)*2,0)/2


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

"duketter" wrote:

I am using Excel 2007 and need some helping on a rounding formula. I would
like my cell to either round to the nearest whole num or ".5" of the number
but it needs to round down. For example:

5.1 would round to 5.0
5.4 would round to 5.0
5.5 would round to 5.5
5.7 would round to 5.5
5.9 would round to 5.5
6.0 would round to 6.0

I am using the Mround function but that rounds up so 5.8 and 5.9 rounds to
6.0 but I need them both to round to 5.5.

Any thoughts? Thanks!



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 905
Default Round Function

"duketter" wrote:
I think I may have got it:
=ROUNDDOWN(A1/0.5,0)*0.5


Yes, that will work. But it is generally better to work with integers
whenever possible, e.g. ROUNDDOWN(A1*2,0)/2 as I wrote. (Our postings
crossed on the wire.)

In this case, it does not matter. But generally, decimal fractions are not
represented exactly internally. For example, suppose you wanted to round
down to the nearest 1/3. ROUNDDOWN(A1*3,0)/3 would be more reliable than
ROUNDDOWN(A1/0.3333,0)*0.3333.

Of course, for that example, you could minimize the error if you were
willing to write 0.333333333333333. That is only about 3.33067E-16 off ;-).


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

"duketter" wrote:
I think I may have got it: =ROUNDDOWN(A1/0.5,0)*0.5

"duketter" wrote:

I am using Excel 2007 and need some helping on a rounding formula. I would
like my cell to either round to the nearest whole num or ".5" of the number
but it needs to round down. For example:

5.1 would round to 5.0
5.4 would round to 5.0
5.5 would round to 5.5
5.7 would round to 5.5
5.9 would round to 5.5
6.0 would round to 6.0

I am using the Mround function but that rounds up so 5.8 and 5.9 rounds to
6.0 but I need them both to round to 5.5.

Any thoughts? Thanks!

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
Round up function shifty Excel Discussion (Misc queries) 3 December 31st 07 11:59 AM
Round Len Function Help [email protected] Excel Worksheet Functions 16 August 25th 06 04:27 AM
how do i set up round function run superman Excel Worksheet Functions 1 October 6th 05 08:13 PM
The ROUND function Louise Excel Worksheet Functions 3 June 23rd 05 02:45 PM
help with round function Scott Excel Worksheet Functions 7 February 9th 05 07:23 PM


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