#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PWS PWS is offline
external usenet poster
 
Posts: 18
Default Rounding Problem

I have a requirement to displace the follwoing pair of data items as
shown:

A simple example is:

2.753, 2.848 ....... 2.75 / 85

I have the following formula:

=TEXT(2.753;"0.00")&" / "&TEXT((2.848-INT(2.848))*100;"00")

Obviously on the workbook the values as cell references

Using the follwoing example I get a 'wrong' result.

2.850 - 2.995 should be shown as 2.85 / 00, but is shown as 2.85 /
100.

I do not understand how 995 becomes 100 rtaher than 00, when the
format requested is "00", but it does.

Can anyone think of a way to achieve what I am looking for?

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Rounding Problem

"PWS" wrote...
....
=TEXT(2.753;"0.00")&" / "&TEXT((2.848-INT(2.848))*100;"00")

Obviously on the workbook the values as cell references

Using the follwoing example I get a 'wrong' result.

2.850 - 2.995 should be shown as 2.85 / 00, but is shown as
2.85 / 100.

I do not understand how 995 becomes 100 rtaher than 00, when the
format requested is "00", but it does.


Well, it's not 995, it's 99.5, and it rounds up to 100, and 100 in
"00" format displays as 100. If you want to it to round to be 00, you
need to toss in ROUND and MOD calls.

=TEXT(A2,"0.00 \/ ")&TEXT(MOD(ROUND((B2-INT(B2))*100,0),1),"00")

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9,101
Default Rounding Problem

I got 2.75 / 85. It is round numbers when using the test() function.
Highlight the cell and then in the Tools Menu - Formula Auditing - Evaluate
Formula. Press the Evalute button and see how the formula is being executed.
You will see the problems.

"PWS" wrote:

I have a requirement to displace the follwoing pair of data items as
shown:

A simple example is:

2.753, 2.848 ....... 2.75 / 85

I have the following formula:

=TEXT(2.753;"0.00")&" / "&TEXT((2.848-INT(2.848))*100;"00")

Obviously on the workbook the values as cell references

Using the follwoing example I get a 'wrong' result.

2.850 - 2.995 should be shown as 2.85 / 00, but is shown as 2.85 /
100.

I do not understand how 995 becomes 100 rtaher than 00, when the
format requested is "00", but it does.

Can anyone think of a way to achieve what I am looking for?


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PWS PWS is offline
external usenet poster
 
Posts: 18
Default Rounding Problem


=TEXT(A2,"0.00 \/ ")&TEXT(MOD(ROUND((B2-INT(B2))*100,0),1),"00")


Unless I am implementing something wrongly, your formula works for the
problem example but does not produce the required result for the other
example!

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Rounding Problem

On 8 Mar 2007 23:58:02 -0800, "PWS" wrote:

I have a requirement to displace the follwoing pair of data items as
shown:

A simple example is:

2.753, 2.848 ....... 2.75 / 85

I have the following formula:

=TEXT(2.753;"0.00")&" / "&TEXT((2.848-INT(2.848))*100;"00")

Obviously on the workbook the values as cell references

Using the follwoing example I get a 'wrong' result.

2.850 - 2.995 should be shown as 2.85 / 00, but is shown as 2.85 /
100.

I do not understand how 995 becomes 100 rtaher than 00, when the
format requested is "00", but it does.

Can anyone think of a way to achieve what I am looking for?


Try this:

=TEXT(A1,"0.00") &" / "&RIGHT(TEXT(100*(A2-INT(A2)),"00"),2)
--ron


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Rounding Problem

"PWS" wrote...
=TEXT(A2,"0.00 \/ ")&TEXT(MOD(ROUND((B2-INT(B2))*100,0),1),"00")


Unless I am implementing something wrongly, your formula works for the
problem example but does not produce the required result for the other
example!


I screwed up. The second argument to MOD should be 100, not 1.

=TEXT(A2,"0.00 \/ ")&TEXT(MOD(ROUND((B2-INT(B2))*100,0),100),"00")

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
Rounding Problem Mike Excel Discussion (Misc queries) 8 September 9th 06 03:59 PM
Rounding off problem..! Neo1 Excel Worksheet Functions 3 March 15th 06 11:56 PM
Averaging/Rounding Equation Problem Hansel Excel Worksheet Functions 3 June 28th 05 08:47 PM
Averaging and Rounding problem Hansel Excel Worksheet Functions 5 June 21st 05 03:24 AM
Simple Rounding Problem Lisa Excel Discussion (Misc queries) 3 March 4th 05 07:48 PM


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