A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

calculating with displayed values



 
 
Thread Tools Display Modes
  #1  
Old September 16th, 2003, 11:33 AM
Tobit
external usenet poster
 
Posts: n/a
Default calculating with displayed values

I have two cells, each displaying numbers to with 2 decimal points

Cell A1 contains the number 15.333333333 (the figure the result of a
calculation)

Cell A2 contains the number 15.33 (the figure is input by the user)

Both will display 15.33

I want to set up cell A3 to warn me if there is a difference in the
displayed values

If I use =IF(A1-A2=0,"","check!"), it will always show check!, because the
actual values of A1-A2 is not 0

How do I adjust the formula so the calculation is between the displayed
values (i.e. 15.33-15.33 = 0) not the actual values ?

Many thanks


--
Tobit Curteis
________________________________

Tobit Curteis Associates
36 Abbey Road
Cambridge
CB5 8HQ
UK

Tel: +44 (0)1223 501958
Fax: +44 (0)1223 304190
E-mail:
Web:
www.tobit-curteis-associates.com


  #2  
Old September 16th, 2003, 12:09 PM
Anon
external usenet poster
 
Posts: n/a
Default calculating with displayed values

"Tobit" wrote in message
...
I have two cells, each displaying numbers to with 2 decimal points

Cell A1 contains the number 15.333333333 (the figure the result of a
calculation)

Cell A2 contains the number 15.33 (the figure is input by the user)

Both will display 15.33

I want to set up cell A3 to warn me if there is a difference in the
displayed values

If I use =IF(A1-A2=0,"","check!"), it will always show check!, because the
actual values of A1-A2 is not 0

How do I adjust the formula so the calculation is between the displayed
values (i.e. 15.33-15.33 = 0) not the actual values ?

Many thanks


--
Tobit Curteis


Maybe this is what you want:
=IF(ROUND(A1,2)-A2=0,"","check!")

Or maybe you should change the formula in A1 to incorporate the rounding:
=ROUND(yourformula,2)
where yourformula is the formula you had before.

It depends on what you are trying to achieve.


  #3  
Old September 16th, 2003, 12:34 PM
Ron Rosenfeld
external usenet poster
 
Posts: n/a
Default calculating with displayed values

On Tue, 16 Sep 2003 10:33:52 +0000 (UTC), "Tobit" wrote:

I have two cells, each displaying numbers to with 2 decimal points

Cell A1 contains the number 15.333333333 (the figure the result of a
calculation)

Cell A2 contains the number 15.33 (the figure is input by the user)

Both will display 15.33

I want to set up cell A3 to warn me if there is a difference in the
displayed values

If I use =IF(A1-A2=0,"","check!"), it will always show check!, because the
actual values of A1-A2 is not 0

How do I adjust the formula so the calculation is between the displayed
values (i.e. 15.33-15.33 = 0) not the actual values ?

Many thanks


If the user entered number will always have two decimal places, then:

=A2=ROUND(A1,2)

will return TRUE in the situation you posit.

If the user can enter a variable number of decimal places, then you need a more
complex formula to determine how many decimal places the user entered. The
*array-entered* formula:


=A2=ROUND(A1,MATCH(TRUE,A2*10^ROW(INDIRECT("1:15") )=INT(A2*10^ROW(INDIRECT("1:15"))),0))

should do that. To **array-enter** a formula, after typing or pasting it in,
hold down ctrlshift while hitting enter. XL will place braces {...}
around the formula.

To use the equality in your IF statement, either:

=IF(A2=ROUND(A1,2),"","check!")

or, (again **array-enter**):

=IF(A2=ROUND(A1,MATCH(TRUE,A2*10^ROW(INDIRECT("1:1 5"))=INT(A2*10^ROW(INDIRECT("1:15"))),0)),"","chec k!")


--ron
  #4  
Old September 16th, 2003, 02:34 PM
Tobit
external usenet poster
 
Posts: n/a
Default calculating with displayed values

Its the ROUND bit that I was trying to understand - with this info, I can
solve the basic problem - many thanks all.

One follow up question

If the resultant value does not = 0, the present response is to display
check!. How would I make the respose to display the resultant value itself

e.g

A1=5.10
A2=5.00

=IF(ROUND(A1,2)-A2=0,"","check!")

Present response = Check!
The response I would like is 0.1

Tobit


Maybe this is what you want:
=IF(ROUND(A1,2)-A2=0,"","check!")

Or maybe you should change the formula in A1 to incorporate the rounding:
=ROUND(yourformula,2)
where yourformula is the formula you had before.

It depends on what you are trying to achieve.





  #5  
Old September 16th, 2003, 02:43 PM
Ron Rosenfeld
external usenet poster
 
Posts: n/a
Default calculating with displayed values

On Tue, 16 Sep 2003 13:34:45 +0000 (UTC), "Tobit" wrote:

Its the ROUND bit that I was trying to understand - with this info, I can
solve the basic problem - many thanks all.

One follow up question

If the resultant value does not = 0, the present response is to display
check!. How would I make the respose to display the resultant value itself

e.g

A1=5.10
A2=5.00

=IF(ROUND(A1,2)-A2=0,"","check!")

Present response = Check!
The response I would like is 0.1

Tobit


=IF(A2=ROUND(A1,2),"",A1-A2)


--ron
  #6  
Old September 16th, 2003, 02:44 PM
Anon
external usenet poster
 
Posts: n/a
Default calculating with displayed values

You would replace "check!" in your formula with ROUND(A1,2)-A2. This would
give
=IF(ROUND(A1,2)-A2=0,"",ROUND(A1,2)-A2)

But then, if you think about it, you don't need the IF statement. You just
use the formula
=ROUND(A1,2)-A2
and turn off the display of zero values.

"Tobit" wrote in message
...
Its the ROUND bit that I was trying to understand - with this info, I can
solve the basic problem - many thanks all.

One follow up question

If the resultant value does not = 0, the present response is to display
check!. How would I make the respose to display the resultant value itself

e.g

A1=5.10
A2=5.00

=IF(ROUND(A1,2)-A2=0,"","check!")

Present response = Check!
The response I would like is 0.1

Tobit


Maybe this is what you want:
=IF(ROUND(A1,2)-A2=0,"","check!")

Or maybe you should change the formula in A1 to incorporate the

rounding:
=ROUND(yourformula,2)
where yourformula is the formula you had before.

It depends on what you are trying to achieve.







  #7  
Old September 16th, 2003, 02:44 PM
Andy B
external usenet poster
 
Posts: n/a
Default calculating with displayed values

Tobit

Try using
=IF(ROUND(A1,2)-A2=0,"",ROUND(A1,2)-A2)

Andy.

"Tobit" wrote in message
...
Its the ROUND bit that I was trying to understand - with this info, I can
solve the basic problem - many thanks all.

One follow up question

If the resultant value does not = 0, the present response is to display
check!. How would I make the respose to display the resultant value itself

e.g

A1=5.10
A2=5.00

=IF(ROUND(A1,2)-A2=0,"","check!")

Present response = Check!
The response I would like is 0.1

Tobit


Maybe this is what you want:
=IF(ROUND(A1,2)-A2=0,"","check!")

Or maybe you should change the formula in A1 to incorporate the

rounding:
=ROUND(yourformula,2)
where yourformula is the formula you had before.

It depends on what you are trying to achieve.







  #8  
Old September 16th, 2003, 03:26 PM
Dave Smith
external usenet poster
 
Posts: n/a
Default calculating with displayed values

If you *always* want to use the value as displayed, you can set up Excel to
do so. Tools-Options-Calculation-Precision as Displayed.

If you want to do so on a case by case basis, use the Round function.
=Round(46/3, 2).

HTH
-Dave


"Tobit" wrote in message
...
I have two cells, each displaying numbers to with 2 decimal points

Cell A1 contains the number 15.333333333 (the figure the result of a
calculation)

Cell A2 contains the number 15.33 (the figure is input by the user)

Both will display 15.33

I want to set up cell A3 to warn me if there is a difference in the
displayed values

If I use =IF(A1-A2=0,"","check!"), it will always show check!, because the
actual values of A1-A2 is not 0

How do I adjust the formula so the calculation is between the displayed
values (i.e. 15.33-15.33 = 0) not the actual values ?

Many thanks


--
Tobit Curteis
________________________________

Tobit Curteis Associates
36 Abbey Road
Cambridge
CB5 8HQ
UK

Tel: +44 (0)1223 501958
Fax: +44 (0)1223 304190
E-mail:
Web:
www.tobit-curteis-associates.com




  #9  
Old September 16th, 2003, 03:36 PM
Tobit
external usenet poster
 
Posts: n/a
Default calculating with displayed values

Works perfectly

Many thanks

--
Tobit


  #10  
Old September 16th, 2003, 06:57 PM
King
external usenet poster
 
Posts: n/a
Default calculating with displayed values

Use Exact()

=if(EXACT(A1,A2),"check","")

"Tobit" wrote in message ...
I have two cells, each displaying numbers to with 2 decimal points

Cell A1 contains the number 15.333333333 (the figure the result of a
calculation)

Cell A2 contains the number 15.33 (the figure is input by the user)

Both will display 15.33

I want to set up cell A3 to warn me if there is a difference in the
displayed values

If I use =IF(A1-A2=0,"","check!"), it will always show check!, because the
actual values of A1-A2 is not 0

How do I adjust the formula so the calculation is between the displayed
values (i.e. 15.33-15.33 = 0) not the actual values ?

Many thanks


--
Tobit Curteis
________________________________

Tobit Curteis Associates
36 Abbey Road
Cambridge
CB5 8HQ
UK

Tel: +44 (0)1223 501958
Fax: +44 (0)1223 304190
E-mail:
Web:
www.tobit-curteis-associates.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.