it pours!),
I am trying to write a statement in MS Excel 2013 that does the following:
If any cell within Column Y (except for cell Y1 - as it is a heading) contains a date, then output "Yes" in cell Z2.
Else output "No" in cell Z2
it pours!),
I am trying to write a statement in MS Excel 2013 that does the following:
If any cell within Column Y (except for cell Y1 - as it is a heading) contains a date, then output "Yes" in cell Z2.
Else output "No" in cell Z2
I firmly believe you're looking for this:
=ISNUMBER(IF(ISNUMBER(I2);I2;DATEVALUE(I2)))
It returns TRUE
if it's either a datenumber or a date stored as a text. I'm sure you can lookup the {=SUM(IF())}
trick that looks for your "any cell" like this:
{=IF(SUM(IF(ISNUMBER(IF(ISNUMBER($Y$2:$Y$1048576),$Y$2:$Y$1048576,DATEVALUE($Y$2:$Y$1048576))),1,0))<>0,"Yes","No")}
Alternatively you may want to check texts only, in which case you want to check for something else. Stay tuned, I'm trying to create that filthy mess of a formula.
Disclaimer: separators are ;
s.
EDIT: back with some more heat.
Since you seem to be picky and looking for the "yy/mm/dd" format I cut it back into parts.
Year: =MID(I2;1;2)
Month: =MID(I2;4;2)
Day: =MID(I2;7;2)
You can re-create the date from this: =DATE(MID(I2;1;2);MID(I2;4;2);MID(I2;7;2))
Unfortunately it accepts say "14/12/32" and outputs #[19]15/01/01#. You've got to check for each of the dateparts (or at least two) if they fit your expectations.
Year: =RIGHT(YEAR(DATE(MID(I2;1;2);MID(I2;4;2);MID(I2;7;2)));2)=MID(I2;1;2)
Month: =MONTH(DATE(MID(I2;1;2);MID(I2;4;2);MID(I2;7;2)))&""=MID(I2;4;2)
Day: =DAY(DATE(MID(I2;1;2);MID(I2;4;2);MID(I2;7;2)))&""=MID(I2;7;2)
The full logical output will look like this (you can take away one argument):
=AND(RIGHT(YEAR(DATE(MID(I2;1;2);MID(I2;4;2);MID(I2;7;2)));2)=MID(I2;1;2);MONTH(DATE(MID(I2;1;2);MID(I2;4;2);MID(I2;7;2)))&""=MID(I2;4;2);DAY(DATE(MID(I2;1;2);MID(I2;4;2);MID(I2;7;2)))&""=MID(I2;7;2))
upon talking to the business, it seems my question is now no longer required. Rather then input "yes" into cell Z2, they are now OK with the earliest date mentioned within Column Y. To achieve this I put the following into cell Z2
=MIN($Y:$Y)
not elegant, but it now meets what they asked for (assuming they do not change their mind again).
Thank you for those who replied, in particular @user3819867