I have some particular data in sheet1 and some other data in sheet2.

I need to compare a specific value(Var1) from sheet1 and return a specific value from the sheet2, and return an output for the same. I successfully did that with this formula

```
=IF(COUNTIF(Sheet2!A:A, A2), "Yes", "No")
```

Sheet1

```
+------+------+---------+---------+
| var1 | var2 | result1 | result2 |
+------+------+---------+---------+
| | | | |
| abc | 123 | yes | yes |
| | | | |
| bcd | 234 | yes | no |
| | | | |
| cde | 456 | no | blank |
+------+------+---------+---------+
```

Sheet2

```
+-------+-------+-------+
| List1 | List2 | List3 |
+-------+-------+-------+
| abc | 123 | |
| bcd | | 123 |
| def | | |
+-------+-------+-------+
```

I need to lookup var1 in list1, and var2 in list2 and list3

I want to compare another value(Var2) in Sheet2, only if the previous result is "Yes", which can be easily achieved with an IF function; but the catch is that it should compare values only from specific rows of Sheet2, which should be plus(+) and minus(-) 2 rows from where Var1 was found in Sheet2.

I am not proficient in VBA, but I have been trying my hand at Excel formulas.