I have a Excel workBook with 2 sheets.


Sheet 1 contains 2 columns. And the data is like the below.

Activity code Status
P1 In Progress
P2 Completed
P3 In Progress
P1 completed
P2 in progress
P3 Yet to start

Activity codes will repeat here.


Sheet 2 contains

Activity code Status
P1
P2
P3

The status should be captured from sheet 1 based on the below logic.


The scenario is like this

If all are yet to start I have to return Yetto start

If all are completed I have to return completed

If any one is In Progress I have to return In Progress.

For Example, For P1 I have In Progress and Completed.In this case I have to return In Progress.

Any Help??

Thanks
Sk5567