View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default using =month(c2) if c2 is blank returns a 1, which messes up data

A blank cell will be treated as 01/01/1900

Actually, it is treated as 1/0/1900.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Roger Govier" wrote in message
...
Hi

A blank cell will be treated as 01/01/1900 if blank and trying
to do date calculations, hence it returns month 1.

You will need to do a check If Isnumber() before carrying out
the Month() function.

Regards

Roger Govier


MHY wrote: