Question: At work we currently use a program that outputs product number combinations in a single cell. For example, in cell C2 there will be "1 4 6" to show the customer ordered products 1, 4 and 6. These numbers are separated by a single space. Is there any if() type formula I could use that would detect if the products were out of order like "1 6 4". I do not want to use the text to column conversion as I want to keep it all in one step. 

Thanks!!

Answer: 
Here is a VBA function which will test if a string of numbers is in ascending order:

```
Function InOrder(nums As String) As Boolean
    Dim numbers As Variant
    Dim i As Long
    numbers = Split(Trim(nums))
    For i = LBound(numbers) To UBound(numbers) - 1
        If Val(numbers(i)) > Val(numbers(i + 1)) Then
            InOrder = False
            Exit Function
        End If
    Next i
    InOrder = True
End Function

```

This could be used directly in the worksheet. `InOrder("1 4 6")` evaluates to `True` but `InOrder("1 6 4")` evaluates to `False`.
Following is IF based formula built using LOOKUP (same as what imaginaryhuman said)

Source cell containing data like `1 4 6` is assumed to be A2. Not tested heavily.

`=IF(LOOKUP(9E+307,-((MID(SUBSTITUTE(" "&A2," ",REPT(" ",99)),ROW($A$1:INDEX(A:A,(LEN(A2)-LEN(SUBSTITUTE(A2," ","")))+1))*99,99)+0)-(MID(SUBSTITUTE(" 0 "&A2," ",REPT(" ",99)),ROW($A$1:INDEX(A:A,(LEN(A2)-LEN(SUBSTITUTE(A2," ","")))+1))*99,99)+0)))>0,"Out of sequence","In sequence")`