![]() |
#1
|
|||
|
|||
![]() I am trying to input a formula for if a cell contains a date then return the month's number else leave the cell blank. I tried this: =IF(A37=(mmmm,dd,yyyy),MONTH(A37),"") The date in A37 is in this format : August 4, 2016 Thanks |
#2
|
||||
|
||||
![]()
What else can the cell contain?
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
#3
|
|||
|
|||
![]()
It can either contain the date, text or be blank
|
#4
|
|||
|
|||
![]()
Hi,
I tried this =IF(OR(A37="",ISTEXT(A37)),"",MONTH(A37)) and it is working. Thanks though. |
#5
|
|||
|
|||
![]()
Try...
=IF(N(A37),MONTH(A37),"") |
#6
|
|||
|
|||
![]()
I managed to verify the content via the function: "CELL":
=CELL("format", A1) Gives an output dependent the cell content. I expect something like: DD.MM.YYYY hh:mm:ss and this correspond to the function output: "D1" A cell format of "hh:mm:ss" gives: "U4" It might be that the function is sensitive to your localization, I have tested it with a German localization, the German variant is: 'ZELLE("format";B18) |
#7
|
|||
|
|||
![]()
What is really the value in cell A37?
Is it a date, and the cell is formatted as "mm,dd,yyyy"? When yes, then (as dates in Excel really are positive numbers) Code:
=IF(A37>0, MONTH(A37), "") When yes, then (assumed "mm,dd,yyyy" is a valid date format for your local settings, but you can handle non-valid values with IFERROR() when there is a possibility for it) Code:
=IF(IFERROR(DATEVALUE(A37),0)>0, MONTH(A37), "") |
#8
|
||||
|
||||
![]() Quote:
__________________
Using O365 v2503 - Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post |
![]() |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
SavGDK | Excel | 2 | 06-24-2016 08:05 AM |
Excel day date month year Function | greginky | Excel | 1 | 01-05-2016 02:19 AM |
![]() |
MattG1225 | Excel | 2 | 12-03-2015 07:44 AM |
![]() |
mbesspiata | Excel | 1 | 01-17-2015 05:02 AM |
calculate date if date entered in cell, do nothing if blank | ConfuddledOne | Excel | 3 | 11-07-2014 09:37 AM |