Question: I have a scenario where I need to identify a result. Below is a sample excel cells with three columns `Prod Name, Qty and Result`.

```
Prod Name    Qty     Result
abc          10 
zyz          9  
test1        5  

```

If the product name is `abc or zyz` and its qty is 10, then I need to add text `Refill` in Column Result.

For any other product. in this case `test1` and its qty is 5, then I need to add the same text `Refill` in Column Result.

Else it will always be `Don't Refill`

Answer: 
Try this formula:

```
=IF(OR(AND(OR(A1="abc", A1="xyz"), B1=10), AND(AND(A1<>"abc", A1<>"xyz"), B1=5)),
    "Refill",
    "Don't Refill")

```
The formula provided by Tim above should work nicely, but if you're looking for VBA approach:

> 
> *(Presuming the data is in a table called Table1 in a sheet called
>  Sheet1)*
> 
> 
> 

```
Private Sub comb_products()

  Dim tbl As ListObject: Set tbl = Sheets("Sheet1").ListObjects("Table1")

For Each Rng In tbl.ListColumns(1).DataBodyRange

 If ((Rng.Value2 = "abc" Or Rng.Value2 = "zyz") And Rng.Offset(0, 1).Value2 = 10) Then
        Rng.Offset(0, 2).Value2 = "Refill"
 ElseIf ((Rng.Value2 <> "abc" Or Rng.Value2 <> "zyz") And Rng.Offset(0, 1).Value2 = 5) Then
        Rng.Offset(0, 2).Value2 = "Refill"
 Else
        Rng.Offset(0, 2).Value2 = "Don't refill"
 End If

Next Rng

End Sub

```

Result as expected: 

[![enter image description here](https://i.stack.imgur.com/sfFtt.png)](https://i.stack.imgur.com/sfFtt.png)