Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
A1: 4
B1: =MyValidation(A1)
=B1
Function MyValidation(ACell)
If ACell Mod 2 = 0 Then
MyValidation = True
Else
MyValidation = False
End If
End Function
=MOD(A1,2)=0
=OR(AND(LEN(A1)=10,VALUE(LEFT(A1,10))>0),AND(LEN(A1)=21,VALUE((LEFT(A1,10)))>0,VALUE((RIGHT(A1,10)))>0))
AH1: =CELL("address")
AH2: =MyValidation(INDIRECT(AH1))
Option Explicit
Public Function MyValidation(ACell) As Boolean
Const MIN_VAL = "1000000000"
Dim sWork As String
Dim sWork1 As String
Dim sWork2 As String
If IsEmpty(ACell) Then
MyValidation = True
Exit Function
End If
sWork = ACell.Value
If Len(sWork) = 10 Then
If IsNumeric(sWork) Then
If sWork >= MIN_VAL Then
MyValidation = True
Exit Function
End If
End If
End If
If Len(sWork) = 21 Then
If Mid(sWork, 11, 1) = "-" Then
sWork1 = Left(sWork, 10)
sWork2 = Right(sWork, 10)
If IsNumeric(sWork1) And IsNumeric(sWork2) Then
If sWork1 >= MIN_VAL And sWork2 >= MIN_VAL Then
If sWork1 < sWork2 Then
MyValidation = True
Exit Function
End If
End If
End If
End If
End If
End Function
=$AH$2