Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Barry
 
Posts: n/a
Default month worksheet function returns wrong value

using formula =month(a1) and in a1 is a date of 01 01 2006 and it returns
value of 1 which is correct, however if i delete the date in a1 it still
returns a value of 1. how can I resolve this?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default month worksheet function returns wrong value

Hi!

You need to test cell A1 and make sure there is a date entered:

=IF(ISNUMBER(A1),MONTH(A1),"")

Or, maybe something like this:

=ISNUMBER(A1)*MONTH(A1)

Will return either 0 or the month number

Biff

"Barry" wrote in message
...
using formula =month(a1) and in a1 is a date of 01 01 2006 and it returns
value of 1 which is correct, however if i delete the date in a1 it still
returns a value of 1. how can I resolve this?



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary L Brown
 
Posts: n/a
Default month worksheet function returns wrong value

Hey, Barry.
A blank cell has a 0 value.
A 0 value as a date is Jan-00-1900 so a return of 1 for Month(Jan-00-1900)
is correct.

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


"Barry" wrote:

using formula =month(a1) and in a1 is a date of 01 01 2006 and it returns
value of 1 which is correct, however if i delete the date in a1 it still
returns a value of 1. how can I resolve this?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Barry
 
Posts: n/a
Default month worksheet function returns wrong value

Gary, could you offer me a solution please.

"Gary L Brown" wrote:

Hey, Barry.
A blank cell has a 0 value.
A 0 value as a date is Jan-00-1900 so a return of 1 for Month(Jan-00-1900)
is correct.

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


"Barry" wrote:

using formula =month(a1) and in a1 is a date of 01 01 2006 and it returns
value of 1 which is correct, however if i delete the date in a1 it still
returns a value of 1. how can I resolve this?

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
daddylonglegs
 
Posts: n/a
Default month worksheet function returns wrong value


This formula would do the same

=(A48<"")*(MONTH($C$1)=MONTH(A48))

and has the advantage that it also works with 1904 date system


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=505841

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
How do I create a schedule from a list of dates ? Gavin Morris Charts and Charting in Excel 2 October 28th 10 04:08 PM
When using MONTH function on Blank Cell!! Returns Month=Jan! mahou Excel Discussion (Misc queries) 6 January 9th 06 02:46 AM
Is there a function to copy an entire worksheet? nickclingan Excel Worksheet Functions 3 December 23rd 05 03:23 PM
Function that Returns Worksheet Name Moset Excel Discussion (Misc queries) 3 July 12th 05 04:07 PM
Excel option to store trendline's coefficients in cells for use Miguel Saldana Charts and Charting in Excel 9 June 20th 05 08:45 PM


All times are GMT +1. The time now is 04:33 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"