Rog said:
I made up a 10 record version of the DB and tried it there and it worked
just fine. Apparently there is a glitch in EXCEL because it seems to be
related to the numbr of records in the DB. This is a real concern;
I don't know of any way around this one. . . .
You could use a udf (user-defined function, written in VBA). It could be
more reliable processing huge ranges.
Function adhoc(r1 As Range, p1 As String, r2 As Range, p2 As String) As Long
Dim k As Long, n As Long
n = r1.Rows.Count
If n <> r2.Rows.Count Or r1.Columns.Count > 1 _
Or r2.Columns.Count > 1 Then
adhoc = -1 'error: return -1: ranges aren't 1D/same size
Exit Function
End If
For k = 1 To n
If CStr(r1.Cells(k, 1).Value) Like p1 _
And CStr(r2.Cells(k, 1).Value) Like p2 Then adhoc = adhoc + 1
Next k
End Function
Use it in formulas like
=adhoc(Portfolio_Review!$X$2:$X$45001,"warranty*",
Portfolio_Review!$AD$2:$AD$45001,"*BELLOW*")
Note that this udf does accept wildcards, and it even accepts character
classes. Read about VBA's Like operator in VBA online help. This will NOT
speed up recalc, but it may be more reliable.