Formula to return "Yes" if the cell is a date

GaryG9595

Board Regular
Joined
Jun 13, 2014
Messages
74
Office Version
  1. 365
Platform
  1. Windows
Hello Everyone,
I am trying to return the value "Yes" in cell B1 if A1 is a date and "No" if it is not.
Seems pretty simple, and I can't be the first person to need this.

DataResults Needed
2/23/2023Yes
123No
carNo
homeNo
2/4/2023Yes
3/3/2023Yes
32154No

I have searched, but could not find a solution. Used Chat GPT as well.
I cannot find a way to differ a number from a date.
I have tried the following formulas, and none of them worked.
IFERROR(IF(ISTEXT(A2),"No",IF(ISNUMBER(A2),IF(INT(A2)=A2,"No","Yes"),"No")),"No")
IF(ISNUMBER(DATEVALUE(A2)),"Yes","No")
IF(ISTEXT(A2),"No","Yes")
IF(ISNUMBER(A2), "No", IF(ISDATE(A2), "Yes", "No"))
IF(ISNUMBER(A2)+ISDATE(A2)=1,"Yes","No")
IFERROR(IF(A2<>"", IF(ISNUMBER(A2)*NOT(ISDATE(A2)), "No", "Yes"), ""), "")
IF(ISNUMBER(A2), IF(ISDATE(A2), "Yes", "No"), "No")
IF(OR(ISNUMBER(A2),A2="Yes"), "Yes", "No")
IF(AND(ISDATE(A2)), "Yes", "No")
IFERROR(IF(ISDATE(A2),"Yes","No"), "No")
IF(OR(ISNUMBER(A2),ISDATE(A2)), "Yes", "No")
IFERROR(IF(OR(ISNUMBER(A2),ISDATE(A2)), "Yes", "No"), "No")
IFERROR(IF(VALUE(A2)>0,IF(ISTEXT(A2),"No","Yes"),"No"),"No")
IF(ISNUMBER(A2), IF(INT(A2)=A2, "Yes", "No"), "No")
IF(ISNUMBER(A2), "No", IF(ISNUMBER(DATEVALUE(A2)), "Yes", "No"))
IFERROR(IF(AND(ISNUMBER(A2),ISDATE(A2)), "Yes", "No"), "No")
IFERROR(IF(ISTEXT(A2), "No", IF(ISNUMBER(A2), "No", IF(ISNUMBER(DATEVALUE(A2)), "Yes", "No"))), "No")
IFERROR(IF(VALUE(A2)=INT(VALUE(A2)), "Yes", "No"), "No")
IFERROR(IF(AND(VALUE(A2)=INT(VALUE(A2)), NOT(ISNUMBER(A2))), "Yes", "No"), "No")
IFERROR(IF(OR(ISNUMBER(A2),ISBLANK(A2)), "No", IFERROR(DATEVALUE(A2),"No")), "No")

Has anyone else ran acroos this and solved or know of a solution?
Thanks,
Gary
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
The cell function is a bit wonky and volatile sometimes. But it might serve.
MrExcelPlayground16.xlsx
AB
13/4/2023Yes
242512No
3PotatoNo
4123No
51/1/2000Yes
65/6/2010Yes
7No
8No
9No
101/1/2000Yes
11No
12No
131/1/2000Yes
141/1/2000Yes
151/1/2000Yes
161/1/2000Yes
Sheet7
Cell Formulas
RangeFormula
B1:B16B1=IF(LEFT(CELL("format",A1),1)="D","Yes","No")
 
Upvote 0
Solution
How about
Excel Formula:
=IF(LEFT(CELL("format",A2))="D","Yes","No")
 
Upvote 0
That Works. You both were on the same page.
I guess we are all still safe from AI.... :)
Thanks again.
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,618
Messages
6,120,544
Members
448,970
Latest member
kennimack

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top