I amtrying to use Vlook-up but maybe it is not the right query to use.

I have attached a dummy file to try and explain what I need to do which is:

The Vlook-up looks up [column A from sheet2]   Column B in Sheet1 and returns the detail from column C in Sheet1

However, I need to make it put only the word 'Pending' in Column B on Sheet2 and 'Open' in Column C on this sheet.

So, in this example 'a123456' has two records on Sheet 1, One is Pending one is Open
'x897456' and 'e654125' have no records on Sheet1 therefore they are Blank
The remainder have either 'Pending' or' Open'.

Maybe this is not possible!!!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Attached herewith modfied sample, see if it helps...
JagwarmanAuthor Commented:
Hi Fayaz, thanks for this, I like it but unfortunately it is not quite what I am looking for.

In the first row where the ref is a123456 I need to put Pending in Cell 'D' and and Open in Cell 'E' as there are two reords in Sheet 1 under that Ref. Also when I copy your formula down in rows 6 and 7 it returns #N/A

Saqib Husain, SyedEngineerCommented:


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
OK see if this peviot helps, i cant think of a formul to help this out sorry.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.