VLookup only if Conditions meet

mohdamir1989

New Member
Joined
Oct 17, 2017
Messages
42
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.

(In Table) =IFERROR(VLOOKUP([@[Mobile Number]]+120000000000,Worksheet[[#All],[Column2]:[Reply]],5,0),"")
(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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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),""),"")
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top