After reviewing some related posts which BigBen provided the lead to, I decided to just write the solution.
I'm sure it could benefit from some efficiency optimizations, and it does not account for extended boolean logic like XOR, etc. It only handles AND, OR, and NOT. But this is more than what I could find anywhere else.
The methodology in this code is to break the full string into one-layer strings (as determined by parentheses) then process each layer of logic using an order of operations of ANDs then ORs. Next, it replaces each one-layer term with a single resulting true or false, then proceeds to the next layer until getting to the top layer of logic. The Function returns a string so that it can call itself and seamlessly feeds results into the original string evaluation.
Public Function EvaluateBooleanString(BooleanString As String) As String
Dim StrPos As Integer
Dim TermStartPos As Integer
Dim TermEndPos As Integer
Dim DepthCounter As Integer
Dim SubBool As String
Dim OrArray() As String
Dim AndArray() As String
Dim OrCounter As Integer
Dim AndCounter As Integer
Dim AndArgs As String
Dim OrArgs As String
TermStartPos = 0
TermEndPos = 0
For StrPos = 1 To Len(BooleanString)
If Mid(BooleanString, StrPos, 1) = "(" Then
DepthCounter = DepthCounter + 1
If DepthCounter = 1 Then TermStartPos = StrPos
End If
If Mid(BooleanString, StrPos, 1) = ")" Then
If DepthCounter = 1 Then
TermEndPos = StrPos
SubBool = EvaluateBooleanString(Mid(BooleanString, TermStartPos + 1, (TermEndPos - TermStartPos) - 1))
BooleanString = Left(BooleanString, TermStartPos - 1) & SubBool & Right(BooleanString, Len(BooleanString) - TermEndPos)
TermStartPos = 0
TermEndPos = 0
StrPos = 1
End If
DepthCounter = DepthCounter - 1
End If
Next StrPos
BooleanString = Replace(BooleanString, "OR", "|", , , vbTextCompare)
BooleanString = Replace(BooleanString, "AND", "&", , , vbTextCompare)
OrArray = Split(BooleanString, "|")
For OrCounter = LBound(OrArray) To UBound(OrArray)
AndArray = Split(OrArray(OrCounter), "&")
If LBound(AndArray) < UBound(AndArray) Then
For AndCounter = LBound(AndArray) To UBound(AndArray)
AndArgs = AndArgs & AndArray(AndCounter) & ","
Next AndCounter
AndArgs = Left(AndArgs, Len(AndArgs) - 1)
Else
AndArgs = AndArray(0)
End If
AndArgs = Replace(AndArgs, "not true", "false", , , vbTextCompare)
AndArgs = Replace(AndArgs, "not false", "true", , , vbTextCompare)
OrArray(OrCounter) = Application.Evaluate("=AND(" & AndArgs & ")")
AndArgs = ""
OrArgs = OrArgs & OrArray(OrCounter) & ","
Next OrCounter
OrArgs = Left(OrArgs, Len(OrArgs) - 1)
OrArgs = Replace(OrArgs, "not true", "false", , , vbTextCompare)
OrArgs = Replace(OrArgs, "not false", "true", , , vbTextCompare)
If LBound(OrArray) < UBound(OrArray) Then
EvaluateBooleanString = Application.Evaluate("=OR(" & OrArgs & ")")
Else
EvaluateBooleanString = OrArgs
End If
End Function