ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Negative Values resulting in error (https://www.excelbanter.com/excel-discussion-misc-queries/232522-negative-values-resulting-error.html)

KKD

Negative Values resulting in error
 
I have a formula set as follows:

=if(c27=v19,(v19),("Error"))

The formula works fine until the value becomes a negative number, then it
returns as a false "Error" even though the values are still equal. How can I
resolve this?
--
KKD

Sheeloo

Negative Values resulting in error
 
I tested with -10 in both C27 and V19 and got -10 as expected...

"KKD" wrote:

I have a formula set as follows:

=if(c27=v19,(v19),("Error"))

The formula works fine until the value becomes a negative number, then it
returns as a false "Error" even though the values are still equal. How can I
resolve this?
--
KKD


Bernard Liengme

Negative Values resulting in error
 
Do you mean that you want 4 and -4 be be treated as equal?
If so: =if(ABS(c27)=ABS(v19), v19,"Error")

OR is the problem that one or both of the numbers results from a calculation
and, while they appear the same, they are different in maybe the 12 place of
decimal? Then use
=if(ABS(c27-v19)< 1E-12, v19,"Error")

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme


"KKD" wrote in message
...
I have a formula set as follows:

=if(c27=v19,(v19),("Error"))

The formula works fine until the value becomes a negative number, then it
returns as a false "Error" even though the values are still equal. How can
I
resolve this?
--
KKD



KKD

Negative Values resulting in error
 
No I don't want absolute values, but the error may be coming from the decimal
calculation as you suggested...without using absolute values, how can I tell
Excel to only look at the whole number plus 2 decimal places? I know how to
make it display only this, but how do I tell it to calculate only this?
--
KKD


"Bernard Liengme" wrote:

Do you mean that you want 4 and -4 be be treated as equal?
If so: =if(ABS(c27)=ABS(v19), v19,"Error")

OR is the problem that one or both of the numbers results from a calculation
and, while they appear the same, they are different in maybe the 12 place of
decimal? Then use
=if(ABS(c27-v19)< 1E-12, v19,"Error")

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme


"KKD" wrote in message
...
I have a formula set as follows:

=if(c27=v19,(v19),("Error"))

The formula works fine until the value becomes a negative number, then it
returns as a false "Error" even though the values are still equal. How can
I
resolve this?
--
KKD




RagDyeR

Negative Values resulting in error
 
Try either of these, depending on what you want displayed:

=IF(ROUND(C27,2)=ROUND(V19,2),V19,"Error")

OR

=IF(ROUND(C27,2)=ROUND(V19,2),ROUND(V19,2),"Error" )

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"KKD" wrote in message
...
No I don't want absolute values, but the error may be coming from the
decimal
calculation as you suggested...without using absolute values, how can I
tell
Excel to only look at the whole number plus 2 decimal places? I know how
to
make it display only this, but how do I tell it to calculate only this?
--
KKD


"Bernard Liengme" wrote:

Do you mean that you want 4 and -4 be be treated as equal?
If so: =if(ABS(c27)=ABS(v19), v19,"Error")

OR is the problem that one or both of the numbers results from a
calculation
and, while they appear the same, they are different in maybe the 12 place
of
decimal? Then use
=if(ABS(c27-v19)< 1E-12, v19,"Error")

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme


"KKD" wrote in message
...
I have a formula set as follows:

=if(c27=v19,(v19),("Error"))

The formula works fine until the value becomes a negative number, then
it
returns as a false "Error" even though the values are still equal. How
can
I
resolve this?
--
KKD






Gord Dibben

Negative Values resulting in error
 
Use the ROUND function or set Precision as Displayed.

Note the second option affects ALL cells.


Gord Dibben MS Excel MVP

On Mon, 1 Jun 2009 12:06:01 -0700, KKD
wrote:

No I don't want absolute values, but the error may be coming from the decimal
calculation as you suggested...without using absolute values, how can I tell
Excel to only look at the whole number plus 2 decimal places? I know how to
make it display only this, but how do I tell it to calculate only this?



Luke M

Negative Values resulting in error
 
You can use the ROUND function.

=IF(ROUND(C27,2)=ROUND(V19,2),V19,"Error")
or
=IF(ROUND(C27,2)=ROUND(V19,2),ROUND(V19,2),"Error" )
depending on how precide you want the resultant to be.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"KKD" wrote:

No I don't want absolute values, but the error may be coming from the decimal
calculation as you suggested...without using absolute values, how can I tell
Excel to only look at the whole number plus 2 decimal places? I know how to
make it display only this, but how do I tell it to calculate only this?
--
KKD


"Bernard Liengme" wrote:

Do you mean that you want 4 and -4 be be treated as equal?
If so: =if(ABS(c27)=ABS(v19), v19,"Error")

OR is the problem that one or both of the numbers results from a calculation
and, while they appear the same, they are different in maybe the 12 place of
decimal? Then use
=if(ABS(c27-v19)< 1E-12, v19,"Error")

best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme


"KKD" wrote in message
...
I have a formula set as follows:

=if(c27=v19,(v19),("Error"))

The formula works fine until the value becomes a negative number, then it
returns as a false "Error" even though the values are still equal. How can
I
resolve this?
--
KKD





All times are GMT +1. The time now is 08:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com