ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Equal "" when zero has a space after it (https://www.excelbanter.com/excel-discussion-misc-queries/153022-equal-when-zero-has-space-after.html)

David P.

Equal "" when zero has a space after it
 
I hope this makes sense. I am referencing a cell that has "0 " - or zero with
a space after it. My intent is for example:

A1=0 - In cell b1 I would type =if(a1=0,"",a1)
or
A1=0 (there is a space after it in this instance) - In b1 I type
if(a1=0,"",if(a1=0 ,"",a1)

Does this make sense? It's not recognizing the space after the zero somehow.
I want the "zero with the space after it" yield "" or blank or nothing.
Thanks for your help on this.
--
David P.

T. Valko

Equal "" when zero has a space after it
 
Does this make sense?

To be honest, no. But here's what you asked for (sort of!):

=IF(A1=0,"",IF(A1="0 ",A1,-----)

The ----- represents the undefined Value_If_False argument for when A1 is
neither 0 or "0 ". If you leave out that agrument it will default to FALSE:

=IF(A1=0,"",IF(A1="0 ",A1)

--
Biff
Microsoft Excel MVP


"David P." wrote in message
...
I hope this makes sense. I am referencing a cell that has "0 " - or zero
with
a space after it. My intent is for example:

A1=0 - In cell b1 I would type =if(a1=0,"",a1)
or
A1=0 (there is a space after it in this instance) - In b1 I type
if(a1=0,"",if(a1=0 ,"",a1)

Does this make sense? It's not recognizing the space after the zero
somehow.
I want the "zero with the space after it" yield "" or blank or nothing.
Thanks for your help on this.
--
David P.




T. Valko

Equal "" when zero has a space after it
 
I think I got confused on this.

Let's see if this is what you want:

If A1 = 0 *or* "0 " then return blank ("") otherwise return A1.

If that's what you want:

=IF(OR(A1=0,A1="0 "),"",A1)

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Does this make sense?


To be honest, no. But here's what you asked for (sort of!):

=IF(A1=0,"",IF(A1="0 ",A1,-----)

The ----- represents the undefined Value_If_False argument for when A1 is
neither 0 or "0 ". If you leave out that agrument it will default to
FALSE:

=IF(A1=0,"",IF(A1="0 ",A1)

--
Biff
Microsoft Excel MVP


"David P." wrote in message
...
I hope this makes sense. I am referencing a cell that has "0 " - or zero
with
a space after it. My intent is for example:

A1=0 - In cell b1 I would type =if(a1=0,"",a1)
or
A1=0 (there is a space after it in this instance) - In b1 I type
if(a1=0,"",if(a1=0 ,"",a1)

Does this make sense? It's not recognizing the space after the zero
somehow.
I want the "zero with the space after it" yield "" or blank or nothing.
Thanks for your help on this.
--
David P.






Peo Sjoblom

Equal "" when zero has a space after it
 
Another way

=IF(TRIM(A1)="0","",A1)

works if there are more than one trailing space as well


--

Regards,

Peo Sjoblom

"T. Valko" wrote in message
...
I think I got confused on this.

Let's see if this is what you want:

If A1 = 0 *or* "0 " then return blank ("") otherwise return A1.

If that's what you want:

=IF(OR(A1=0,A1="0 "),"",A1)

--
Biff
Microsoft Excel MVP


"T. Valko" wrote in message
...
Does this make sense?


To be honest, no. But here's what you asked for (sort of!):

=IF(A1=0,"",IF(A1="0 ",A1,-----)

The ----- represents the undefined Value_If_False argument for when A1 is
neither 0 or "0 ". If you leave out that agrument it will default to
FALSE:

=IF(A1=0,"",IF(A1="0 ",A1)

--
Biff
Microsoft Excel MVP


"David P." wrote in message
...
I hope this makes sense. I am referencing a cell that has "0 " - or zero
with
a space after it. My intent is for example:

A1=0 - In cell b1 I would type =if(a1=0,"",a1)
or
A1=0 (there is a space after it in this instance) - In b1 I type
if(a1=0,"",if(a1=0 ,"",a1)

Does this make sense? It's not recognizing the space after the zero
somehow.
I want the "zero with the space after it" yield "" or blank or nothing.
Thanks for your help on this.
--
David P.








Dallman Ross

Equal "" when zero has a space after it
 
In , T. Valko
spake thusly:

Let's see if this is what you want:

If A1 = 0 *or* "0 " then return blank ("") otherwise return A1.

If that's what you want:

=IF(OR(A1=0,A1="0 "),"",A1)


I'm left wondering if the OP has a space merely because he
wants it there for nice formatting purposes. If that is the
case, I'd suggest to him to remove the space and use formatting
options to put "space" there instead. E.g., format as type
"Accounting" is one easy way to get there.)

--
dman

Harlan Grove[_2_]

Equal "" when zero has a space after it
 
"Peo Sjoblom" wrote...
Another way

=IF(TRIM(A1)="0","",A1)

works if there are more than one trailing space as well

....

Unless " 0", " 0", "0 ", "0 ", etc. should be treated differently, in
which case it doesn't work.



David P.

Equal "" when zero has a space after it
 
Thank you all.
--
David P.


"David P." wrote:

I hope this makes sense. I am referencing a cell that has "0 " - or zero with
a space after it. My intent is for example:

A1=0 - In cell b1 I would type =if(a1=0,"",a1)
or
A1=0 (there is a space after it in this instance) - In b1 I type
if(a1=0,"",if(a1=0 ,"",a1)

Does this make sense? It's not recognizing the space after the zero somehow.
I want the "zero with the space after it" yield "" or blank or nothing.
Thanks for your help on this.
--
David P.



All times are GMT +1. The time now is 03:41 PM.

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