Short story short:
I want to check the cell C21 if it contains a date. I can't use VB cause it's deactivated by GPO.
Used this from this page
D21 contains this:
=WENN(ISTZAHL(DATWERT(C21));"date";"no date")
in english
=IF(ISNUMBER(DATEVALUE(C21))...
C21 this:
=HEUTE() # in english: =TODAY() Maybe other dates later, but allways in the correct format
but it allways returns "no date"
Use this: =IF(LEFT(CELL("format",C21))="D",..,..). Learn more about CELL formula here.
In your example =TODAY() already a real date and not a date stored as text, so doesn't make too much sense to use DATEVALUE there.
Update
Here are some example dates and how CELL recognize them:
format value output
dd/mmmm/yyyy 12/June/2015 D1
dd/mm/yyyy 12/06/2015 D1
yyyy 2015 G
general 2015 G
dd/mm 12/06 D2
mmmm June G
dd mmmm yyyy 12 June 2015 G
Note: CELL is not volatile, so if the format of source cell is changed it won't be refreshed automatically, you need to either recalculate your sheet / book, either open the formula and press enter (also automatice recalculation initiated by any other volatile formula will cause it to refresh).
Use this formula, the expression will return TRUE if cell A1 contains an invalid date.
=ISERROR(DATE(DAY(A1),MONTH(A1),YEAR(A1)))
This formula works by evaluating each component part of the date: DAY, MONTH and YEAR and then aggregating them using the DATE function.
ISERROR will the catch any errors by returning TRUE (invalid) otherwise FALSE (valid).
Obviously the date value in cell (A1) must contain values >= 01/01/1900.
Useful for "Conditional Formatting".
Excel stores dates as numbers. 1 is 1-Jan-1900.
When it comes to numbers in a cell, Excel cannot tell if a number is meant to be a number or a date.
Today is 11/06/2015 as a date and 42166 as a number. For the consumer of a spreadsheet, the cell can be formatted to display the number as any number format or as a date. Excel formulas cannot tell whether the number in that cell is "meant" to be a date.
So, there is no Excel formula that you can use in a spreadsheet that will tell you if cell A1 is about 42166 widgets or if contains the date of June-11-2015.
Some of provided answers, checks cell format, which will not considers cell value, as you can format differently each cell no matter of its content, for checking if a cell value is date you can use this:
if(ISERROR(VALUE(c21)),"No Date", ----do staff for Date ----)
or shorter version which just will inform you "no date" status. If a date entry is find, it will return its numerical value instead:
IFERROR(VALUE(c21),"No Date")
hope this helps,
Cheers,
M
use the following formula ...
=IF(NOT(ISERROR(DATEVALUE(TEXT(C21,"mm/dd/yyyy")))),"valid date","invalid date")
I think it will solve your problem.
If the value is a string this method would work.
TEXT(DATE(VALUE(RIGHT(AI8,4)),VALUE(MID(TRIM(AI8),4,2)),VALUE(LEFT(AI8,2))),"dd.mm.yyyy") = AI8
Just wanted to add to the discussion that although you can check with a date(year;month;day) it will give you false positives, since the way it works is that it seems to just roll over values that exceed the logical limit, i.e. if you have the date 99-12-35 it will assume that you meant to write Jan 4th 2000, since that is the 35 - the 31 days of December. In other words, you will find some errors, but not all. Same goes for months exceeding 12.
try this formula (depends on date format):
=IF(DATE(TEXT(C21;"yyyy");TEXT(C21;"mm");TEXT(C21;"dd"));"contains date";"doesn't")
I tried every solution posted but none of them work if there are empty cells in the date cells, so I added a check to GBGOLC's answer and now it works with empty cells:
=IF(NOT(OR(ISBLANK(C21),ISERR(DATE(DAY(C21),MONTH(C21),YEAR(C21))))),"Yes it is a date","Not a date")
Related
Currently, I am using the EDATE function in cell A5.
It is displaying the date as "February".
I want this "February" to be displayed as "FEBRUARY". (simple change to upper case)
How can I do this whilst keeping the formula currently in cell A5?
Cell A5 formula : =EDATE(A4,1)
=PROPER(TEXT(EDATE(A4,1),"MMMM"))
If your cell content doesn't need to be a numeric date. Means you don't calculate with this cell and it is just for displaying purpose, then use the following formula
=UPPER(TEXT(EDATE(A4,1),"MMMM"))
Use a font which is all capitals e.g.Perpertua Titling MT
Otherwise conditional format
dd \F\E\B\R\U\A\R\Y yyyy
with custom formula
=month(C1)=2
and so on for all 12 months.
=UPPER(TEXT(EDATE(A4,1),"dd MMMM yyyy"))
This works quite well when using other date functions like e.g. EOMONTH
I am making an on-call schedule in excel and I can't for the life of me find an easy way to populate the dates. For example, someone is on call from Monday to Sunday, January 2nd - January 8th. Then the next person is on call from January 9th - January 15th. I am trying to figure out a way or formula to just "Drag" down the column and it input the next 7 day range. I have tried input the start date and end date in a separate cell, then using concatenate but it returns the date number in excel (forgot what its called). I also tried =(A1&" - "&B1) but that returns the same 5 digit number.
Any help or pointers are greatly appreciated!
Previous date + 7
If you have genuine dates, say in cells A1 "start date" and B1 "end date":
Jan 2 Jan 8
Then the next line will be
=A1+7 =B1+7
Verify Dates
To see, if the "Dates" you entered are realy dates excel can work with like that, apply "General formatting" to the A1 and B1 cells. If the resulting value is an Interer or a Decimal number, you are golden. If the resulting value did not change, you have a text and you need to apply different approach.
Perhaps you are looking for this:
=TEXT(A1,"d-mmm")&" - "&TEXT(B1,"d-mmm")
The formatting specification can be copied from the formatted cell properties.
I have a cell that has the formula =INDIRECT(CHAR(COLUMN()+65)&ROW())*MONTH($A$1)/12 where INDIRECT references an integer and $A$1 is a date. For some reason, the MONTH part converts the entire cell into a date instead of a number. How do I change the formula to have it return a number in number format? (Manually changing each cell through the ribbon is not an option for me).
I haven't tested this (and I can't comment till I get 50 rep), but you could wrap the whole thing in a text formula, then multiply by 1:
=TEXT(INDIRECT(CHAR(COLUMN()+65)&ROW())*MONTH($A$1)/12,"#")*1
Hope this helps!
Here's what I'm looking for....
Trying to Sum the count of worksheet 'Results 2013' column G items
IF Cell A matches "Canada"
IF Cell E (date) is July
Having trouble with the date portion of the SUMIFS statement below.
SUMIFS('Results 2013'!$G$2:$G$510,'Results 2013'!$A2:$A$510
,"=Canada",'Results 2013'!$E2:$E510,MONTH('Results 2013'!$E2:$E510)=7)
Example value of "Results 2013"$E$480 is
I try this formula, and it provides back "January" which is obviously incorrect.
=TEXT(MONTH('Results 2013'!$E$480),"mmmm")
However, this formula, results in TRUE or 1
=IF(MONTH('Results 2013'!$E$480)=7,1,0)
The simplest solution is to add a column Month using the MONTH function to compute values, and then refer to this new column in SUMIFS.
This tests whether the date values in column E fall within the range 7/1/2013 and 7/31/2013. If your dates all fall within 2013, it will work.
SUMIFS('Results 2013'!$G$2:$G$510,'Results 2013'!$A2:$A$510,"=Canada",
'Results 2013'!$E2:$E510,">="&DATE(2013,7,1),
'Results 2013'!$E2:$E510,"<="&DATE(2013,7,31))
This array formula will work with the more general case of dates falling within any year:
=SUM(G2:G510*(A2:A510="Canada")*(MONTH(E2:E510)=7))
You could use an array formula , then you can use month on the entire column:
{SUM(if('Results 2013'!$A2:$A$510="Canada",1,0)*if(MONTH('Results 2013'!$E2:$E510)=7,'Results 2013'!$G$2:$G$510,0))}
just remember to use ctrl+shift+enter rather than the usual enter to finish the formula
I'm looking for a formula which allows me to look at a cell and check if it greater than or equal to today's date and to return a worded result such as "overdue". If it is blank to return another word, or nothing.
I have tried copying the result from the source cell (O10) into another cell (Y10) and used an if statement but this seems overly laborious - there must be a way to read the information from the source cell? See below. It also returns overdue when the cell is blank :(
=IF(O10>Y10,"OVERDUE","NOT DUE")
You can enter the following formula in the cell where you want to see the Overdue or Not due result:
=IF(ISBLANK(O10),"",IF(O10<TODAY(),"Overdue","Not due"))
This formula first tests if the source cell is blank. If it is, then the result cell will be filled with the empty string. If the source is not blank, then the formula tests if the date in the source cell is before the current day. If it is, then the value is set to Overdue, otherwise it is set to Not due.
I think this will cover any possible scenario for what is in O10:
=IF(ISBLANK(O10),"",IF(O10<TODAY(),IF(TODAY()-O10<>1,CONCATENATE("Due in ",TEXT(TODAY()-O10,"d")," days"),CONCATENATE("Due in ",TEXT(TODAY()-O10,"d")," day")),IF(O10=TODAY(),"Due Today","Overdue")))
For Dates that are before Today, it will tell you how many days the item is due in. If O10 = Today then it will say "Due Today". Anything past Today and it will read overdue. Lastly, if it is blank, the cell will also appear blank. Let me know what you think!
The formula provided by Blake doesn't seem to work for me. For past dates it returns due in xx days and for future dates, it returns overdue. Also, it will only return 15 days overdue, when it could actually be 30, 60 90+.
I created this, which seems to work and provides 'Due in xx days', 'Overdue xx days' and 'Due Today'.
=IF(ISBLANK(O10),"",IF(DAYS(TODAY(),O10)<0,CONCATENATE("Due in ",-DAYS(TODAY(),O10)," Days"),IF(DAYS(TODAY(),O10)>0,CONCATENATE("Overdue ",DAYS(TODAY(),O10)," Days"),"Due Today")))