If several dates are entered a yes is entered

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

1 response

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