If several dates are entered a yes is entered

Closed
bbrewer88 Posts 1 Registration date Wednesday July 11, 2018 Status Member Last seen July 11, 2018 - Jul 11, 2018 at 09:15 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Jul 12, 2018 at 11:28 AM
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 response

TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 555
Jul 12, 2018 at 11:28 AM
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