Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MHY MHY is offline
external usenet poster
 
Posts: 1
Default using =month(c2) if c2 is blank returns a 1, which messes up data


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default using =month(c2) if c2 is blank returns a 1, which messes updata

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:
  #3   Report Post  
Posted to microsoft.public.excel.programming
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:



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
sumif returns blank if all cells blank Heliocracy Excel Worksheet Functions 7 January 19th 09 08:59 PM
Query returns blank cells where there should be data WillrSF Excel Discussion (Misc queries) 1 December 3rd 08 08:43 AM
Function that returns the month name Rapunzel Excel Worksheet Functions 2 January 24th 07 08:20 AM
Formula that returns Col A data in Col B, but omitting blank cells SteveC Excel Worksheet Functions 7 January 25th 06 06:48 PM
When using MONTH function on Blank Cell!! Returns Month=Jan! mahou Excel Discussion (Misc queries) 6 January 9th 06 02:46 AM


All times are GMT +1. The time now is 09:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"