| A | B | C | D |
---|
2~~5~~18~~ | | | | |
-11~~-60~~-3 | | | | |
55~~80 | | | | |
2~~5~~18~~ | | | | |
20~~50~~60 | | | | |
30~~ 60~~ 70 | | | | |
2~~5~~18~~-15 | | | | |
| | | | |
<tbody>
[TD="align: center"]1[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"][/TD]
[TD="align: right"]18[/TD]
[TD="align: center"]2[/TD]
[TD="align: right"]#N/A[/TD]
[TD="align: right"][/TD]
[TD="align: right"]-3[/TD]
[TD="align: center"]3[/TD]
[TD="align: right"]80[/TD]
[TD="align: right"][/TD]
[TD="align: right"]80[/TD]
[TD="align: center"]4[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"][/TD]
[TD="align: right"]18[/TD]
[TD="align: center"]5[/TD]
[TD="align: right"]60[/TD]
[TD="align: right"][/TD]
[TD="align: right"]60[/TD]
[TD="align: center"]6[/TD]
[TD="align: right"]70[/TD]
[TD="align: right"][/TD]
[TD="align: right"]70[/TD]
[TD="align: center"]7[/TD]
[TD="align: right"]18[/TD]
[TD="align: right"][/TD]
[TD="align: right"]18[/TD]
[TD="align: center"]8[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]
</tbody>
The Excel Formula works great unless you only have negative numbers.
If you're interested in the UDF: Create a new Module within the VBA editor and paste the following:
Code:
Public Function HighVal(StrIn As String) As Integer
Dim TmpStr As String
Dim StrArray() As String, IntArray() As Integer
Dim Cntr As Integer, IntCntr As Integer
TmpStr = WorksheetFunction.Substitute(StrIn, " ", "")
TmpStr = WorksheetFunction.Substitute(TmpStr, "~", ",`,")
TmpStr = WorksheetFunction.Substitute(TmpStr, ",,", ",`,")
If Right(TmpStr, 1) = "," Then TmpStr = Left(TmpStr, Len(TmpStr) - 1)
StrArray = Split(TmpStr, ",")
For Cntr = 1 To UBound(StrArray)
If StrArray(Cntr) <> "`" Then
IntCntr = IntCntr + 1
ReDim Preserve IntArray(1 To IntCntr)
IntArray(IntCntr) = CInt(StrArray(Cntr))
End If
Next Cntr
HighVal = WorksheetFunction.Max(IntArray)
End Function