View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
GS[_2_] GS[_2_] is offline
external usenet poster
 
Posts: 3,514
Default Date and If problem

Claus Busch has brought this to us :
Hi Bob,

Am Thu, 21 Jun 2012 12:46:58 -0700 (PDT) schrieb Bob:

I am using in B2

=IF(Report!H6 =" ";"";Report!H6)


there is a typo in your formula. If Report!H6=" " means if Report!H6
contains a space. If Report!H6 is empty you get the value of an empty
cell 0 and that's 00. January 1900.
Try:
=IF(Report!H6="","",Report!H6)


Regards
Claus Busch


To avoid ambiguity about cells being empty or not, I use...

=NOT(Reort!H6)

...which evaluates to FALSE for the range if it's empty, meaning the
return is TRUE for the formula. So...

=IF(NOT(Report!H6),"",Report!H6)

...which translates that
IF Report!H6 is empty THEN
return an empty string
ELSE
return the value in Report!H6


Alternatively, to check if a cell is not empty...

=IF(LEN(Report!H6),Report!H6,"")

...which translates that
IF Report!H6 is NOT empty THEN
return the value in Report!H6
ELSE
return an empty string

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion