ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Negative Zero (-0) Exporting to Excel (https://www.excelbanter.com/excel-discussion-misc-queries/78718-negative-zero-0-exporting-excel.html)

Cydney

Negative Zero (-0) Exporting to Excel
 
I've come across an issue I can't seem to understand or resolve. Would
appreciate it if someone could help me out.

I'm getting financial data from an ODBC source and then performing a simple
subtraction calculation of two fields. With the format set at 15 decimals,
the 2 numbers are the same. When I subtract one from the other, in Access it
returns "0".

That's all just fine. However, when I copy that query result into Excel, the
number is "-0". Why is that? It prevents me from creating a formula with an
IF statement that something like " =IF(b1=0,0,4/2) ". I need the number to
return 0, not negative 0.

Helllp??
--
THX cs

Cydney

Negative Zero (-0) Exporting to Excel
 
Using if(ABS(b1)=0,... (or if(--b1=0,...) worked.

However.. I still don't understand why it would export as a negative 0 when
it should already be absolute zero.

(By "export" I mean copy and paste the data from and Access query into Excel
to perform further calculations.)

p.s. "4/2" is a simple example of the formula I'm using for the purpose of
explanation here.
--
THX cs


"Sloth" wrote:

I don't know how to fix you import/export problem but you should probably be
able to change your formula to this

=IF(--b1=0,0,4/2)

PS-why do you use 4/2 instead 2?

"Cydney" wrote:

I've come across an issue I can't seem to understand or resolve. Would
appreciate it if someone could help me out.

I'm getting financial data from an ODBC source and then performing a simple
subtraction calculation of two fields. With the format set at 15 decimals,
the 2 numbers are the same. When I subtract one from the other, in Access it
returns "0".

That's all just fine. However, when I copy that query result into Excel, the
number is "-0". Why is that? It prevents me from creating a formula with an
IF statement that something like " =IF(b1=0,0,4/2) ". I need the number to
return 0, not negative 0.

Helllp??
--
THX cs


Sloth

Negative Zero (-0) Exporting to Excel
 
For some reason it is importing it as text. You can force a change by
copying a blank cell and then using "paste special" on the cells in question
(simply select all your data). Select add and click ok. All -0's should be
converted to the number 0.

"Cydney" wrote:

Using if(ABS(b1)=0,... (or if(--b1=0,...) worked.

However.. I still don't understand why it would export as a negative 0 when
it should already be absolute zero.

(By "export" I mean copy and paste the data from and Access query into Excel
to perform further calculations.)

p.s. "4/2" is a simple example of the formula I'm using for the purpose of
explanation here.
--
THX cs


"Sloth" wrote:

I don't know how to fix you import/export problem but you should probably be
able to change your formula to this

=IF(--b1=0,0,4/2)

PS-why do you use 4/2 instead 2?

"Cydney" wrote:

I've come across an issue I can't seem to understand or resolve. Would
appreciate it if someone could help me out.

I'm getting financial data from an ODBC source and then performing a simple
subtraction calculation of two fields. With the format set at 15 decimals,
the 2 numbers are the same. When I subtract one from the other, in Access it
returns "0".

That's all just fine. However, when I copy that query result into Excel, the
number is "-0". Why is that? It prevents me from creating a formula with an
IF statement that something like " =IF(b1=0,0,4/2) ". I need the number to
return 0, not negative 0.

Helllp??
--
THX cs



All times are GMT +1. The time now is 08:37 PM.

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