#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 542
Default averaging data

When averaging data in EXCEL I need to round up at 5 or above only if the
preceding number is odd, if it is even, the number is not rounded up.
Example, 1.5245 rounds to 1.524, 1.5255 rounds up to 1.526. Is it possible to
do this in EXCEL?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default averaging data

This sounds like a nightmare!

1.5245
1.5255

Are these values calculated? If so, the true value can be more than 4
decimal places. I was able to do it using a rather ugly IF formula based on
every number being set at 4 decimal places or being integers. Do you have
values like:

10.2
0.522
150.009

Biff

"James" wrote in message
...
When averaging data in EXCEL I need to round up at 5 or above only if the
preceding number is odd, if it is even, the number is not rounded up.
Example, 1.5245 rounds to 1.524, 1.5255 rounds up to 1.526. Is it possible
to
do this in EXCEL?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 542
Default averaging data

the numbers would range from about .50000 to 1.9000

"T. Valko" wrote:

This sounds like a nightmare!

1.5245
1.5255

Are these values calculated? If so, the true value can be more than 4
decimal places. I was able to do it using a rather ugly IF formula based on
every number being set at 4 decimal places or being integers. Do you have
values like:

10.2
0.522
150.009

Biff

"James" wrote in message
...
When averaging data in EXCEL I need to round up at 5 or above only if the
preceding number is odd, if it is even, the number is not rounded up.
Example, 1.5245 rounds to 1.524, 1.5255 rounds up to 1.526. Is it possible
to
do this in EXCEL?




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,726
Default averaging data

See if this works for you

=IF(RIGHT(A1,1)<"5",ROUND(A1,LEN(MOD(A1,1))-3),
IF(ISEVEN(MID(A1,LEN(A1)-1,1)),ROUNDDOWN(A1,LEN(MOD(A1,1))-3),ROUNDUP(A1,LEN(MOD(A1,1))-3)))

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"James" wrote in message
...
When averaging data in EXCEL I need to round up at 5 or above only if the
preceding number is odd, if it is even, the number is not rounded up.
Example, 1.5245 rounds to 1.524, 1.5255 rounds up to 1.526. Is it possible
to
do this in EXCEL?



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,572
Default averaging data

Try this:

=IF(OR(ISEVEN(LEFT(RIGHT(A1,2))),RIGHT(A1)<"5"),--LEFT(A1,LEN(A1)-1),ROUND(A
1,LEN(A1-INT(A1))-3))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"James" wrote in message
...
When averaging data in EXCEL I need to round up at 5 or above only if the
preceding number is odd, if it is even, the number is not rounded up.
Example, 1.5245 rounds to 1.524, 1.5255 rounds up to 1.526. Is it possible

to
do this in EXCEL?




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 740
Default averaging data

Hi james, it seems confusing, your subject is titled as averaging data yet
you like to have conditional rounding of each data..where is the question
about averaging data..please explain...
happy holidays.

"James" wrote:

the numbers would range from about .50000 to 1.9000

"T. Valko" wrote:

This sounds like a nightmare!

1.5245
1.5255

Are these values calculated? If so, the true value can be more than 4
decimal places. I was able to do it using a rather ugly IF formula based on
every number being set at 4 decimal places or being integers. Do you have
values like:

10.2
0.522
150.009

Biff

"James" wrote in message
...
When averaging data in EXCEL I need to round up at 5 or above only if the
preceding number is odd, if it is even, the number is not rounded up.
Example, 1.5245 rounds to 1.524, 1.5255 rounds up to 1.526. Is it possible
to
do this in EXCEL?




  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default averaging data

You didn't say if these numbers were calculated. If the numbers are
calculated Excel will not display a number like 1.9000 unless it's formatted
to display all the decimal places but the true underlying value of the cell
is 1.9.

Try this:

=IF(MOD(A2,1),IF(LEN(MOD(A2,1))<6,A2,IF(MOD(MID(MO D(A2,1),5,1)+0,2),ROUND(A2,3),TRUNC(A2,3))),A2)

Biff

"James" wrote in message
...
the numbers would range from about .50000 to 1.9000

"T. Valko" wrote:

This sounds like a nightmare!

1.5245
1.5255

Are these values calculated? If so, the true value can be more than 4
decimal places. I was able to do it using a rather ugly IF formula based
on
every number being set at 4 decimal places or being integers. Do you have
values like:

10.2
0.522
150.009

Biff

"James" wrote in message
...
When averaging data in EXCEL I need to round up at 5 or above only if
the
preceding number is odd, if it is even, the number is not rounded up.
Example, 1.5245 rounds to 1.524, 1.5255 rounds up to 1.526. Is it
possible
to
do this in EXCEL?






  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default averaging data

0.5 = #VALUE!
1 = 0
0.25 = 0.2
1.5409 = 1.541

Biff

"Bob Phillips" wrote in message
...
See if this works for you

=IF(RIGHT(A1,1)<"5",ROUND(A1,LEN(MOD(A1,1))-3),
IF(ISEVEN(MID(A1,LEN(A1)-1,1)),ROUNDDOWN(A1,LEN(MOD(A1,1))-3),ROUNDUP(A1,LEN(MOD(A1,1))-3)))

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"James" wrote in message
...
When averaging data in EXCEL I need to round up at 5 or above only if the
preceding number is odd, if it is even, the number is not rounded up.
Example, 1.5245 rounds to 1.524, 1.5255 rounds up to 1.526. Is it
possible to
do this in EXCEL?





  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default averaging data

0.5 = #VALUE!
1 = #VALUE!
0.25 = 0.2

Biff

"Ragdyer" wrote in message
...
Try this:

=IF(OR(ISEVEN(LEFT(RIGHT(A1,2))),RIGHT(A1)<"5"),--LEFT(A1,LEN(A1)-1),ROUND(A
1,LEN(A1-INT(A1))-3))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"James" wrote in message
...
When averaging data in EXCEL I need to round up at 5 or above only if the
preceding number is odd, if it is even, the number is not rounded up.
Example, 1.5245 rounds to 1.524, 1.5255 rounds up to 1.526. Is it
possible

to
do this in EXCEL?




  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 837
Default averaging data

http://groups.google.com/group/micro...7fce6145b70d69

Jerry

"James" wrote:

When averaging data in EXCEL I need to round up at 5 or above only if the
preceding number is odd, if it is even, the number is not rounded up.
Example, 1.5245 rounds to 1.524, 1.5255 rounds up to 1.526. Is it possible to
do this in EXCEL?



  #11   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 542
Default averaging data

Thank you, it worked very well. I could not have done it on my own.

"Bob Phillips" wrote:

See if this works for you

=IF(RIGHT(A1,1)<"5",ROUND(A1,LEN(MOD(A1,1))-3),
IF(ISEVEN(MID(A1,LEN(A1)-1,1)),ROUNDDOWN(A1,LEN(MOD(A1,1))-3),ROUNDUP(A1,LEN(MOD(A1,1))-3)))

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)


"James" wrote in message
...
When averaging data in EXCEL I need to round up at 5 or above only if the
preceding number is odd, if it is even, the number is not rounded up.
Example, 1.5245 rounds to 1.524, 1.5255 rounds up to 1.526. Is it possible
to
do this in EXCEL?




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
macro unouwanme Excel Discussion (Misc queries) 9 August 31st 06 09:38 PM
Macro question Chris Excel Worksheet Functions 12 July 7th 06 01:23 AM
Inputting data to one worksheet for it effect another daedalus1 Excel Discussion (Misc queries) 1 June 25th 06 04:39 PM
ranking query JaimeTimbrell Excel Discussion (Misc queries) 2 February 16th 06 08:09 AM
Inserting a new line when external data changes Rental Man Excel Discussion (Misc queries) 0 January 11th 06 07:05 PM


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