# VLookup only if Conditions meet

#### mohdamir1989

##### New Member
Hi All,

I am trying to achieve a simple logic. Tried to search over google and forum before asking but couldn't get anyway near.

I am currently using below formula which is working fine but need to manually delete extra rows to obtain conditions.

(Just for clarification Without Table) =IFERROR(VLOOKUP(X2+120000000000,Sheet1!B:F,5,0),"")

I want vLookup to work only if value is equal to "Y" or "N" and ignore all other values in that column (From where the results are being pulled).

Is it possible by anyway?

Thanking in anticipation.

Best Regards
Amir

### Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

#### VBE313

##### Well-known Member
Code:
``=IF(OR(IFERROR(VLOOKUP(X2+120000000000,Sheet1!B:F,5,0),"")="Y",IFERROR(VLOOKUP(X2+120000000000,Sheet1!B:F,5,0),"")="N"),IFERROR(VLOOKUP(X2+120000000000,Sheet1!B:F,5,0),""),"")``

• mohdamir1989

#### mohdamir1989

##### New Member
Code:
``=IF(OR(IFERROR(VLOOKUP(X2+120000000000,Sheet1!B:F,5,0),"")="Y",IFERROR(VLOOKUP(X2+120000000000,Sheet1!B:F,5,0),"")="N"),IFERROR(VLOOKUP(X2+120000000000,Sheet1!B:F,5,0),""),"")``
Thank you so much @VBE313 for a prompt response. It is working perfectly fine if the data is "Newest to Oldest" date wise. But not working if the data is "Oldest to Newest". As Vlookup considers first value only. Is there any other way out.
I am actually working around the customer's first and last feedback and to do so I have 2 different sheets. I am using different sorting in both of the sheets to find the responses. For example, the customer replied, "N" dated 02-02-2020 and later he converted to "Y" dated 05-02-2020 and on date 02-02-2020 he also replied "1" which here I am ignoring.

By using this formula it returns first feedback "Y" but not considering it the last, as the customer also replied "1".

Looking forward to your valuable feedback

Replies
3
Views
54
Replies
0
Views
191
Replies
1
Views
365
Replies
1
Views
375
Replies
0
Views
99