If several dates are entered a yes is entered

Closed
Report
Posts
1
Registration date
Wednesday July 11, 2018
Status
Member
Last seen
July 11, 2018
-
Posts
2847
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 13, 2022
-
Hello,

I'm trying to figure out how to do this in Excel. I'm trying to come up with a formula to say if several dates are entered into cells it'll show a yes in a separate box. So basically if E1, G1, & M1 have a date entered then X1 will show yes. I've tried to figure it out and just can't get it. Thanks

1 reply

Posts
2847
Registration date
Sunday September 12, 2010
Status
Moderator
Last seen
January 13, 2022
491
Hi Bbrewer88,

Not sure if that can be done without the use of VBA.

When Excel is open:
- Hit Alt+F11
- Click on 'Insert' on the top menu of the newly opened window
- Select 'Module'
- Paste the code below in the big white field
- Visual Basic window can now be closed

Here is the code:
Function mDate(xCell, yCell, zCell As Range) As String
If IsDate(xCell) * IsDate(yCell) * IsDate(zCell) = True Then
    mDate = "Yes"
Else
    mDate = "No"
End If
End Function


Now we have a new function we can use in X1:
=mDate(E1,G1,M1)

Best regards,
Trowa
0