Hi everyone,
i have my employees data in sheet1.
If i entered any project code in sheet2
column b1 it will diplay all the employees
details along with emp code and name in next rows
sample data file attached
Hi everyone,
i have my employees data in sheet1.
If i entered any project code in sheet2
column b1 it will diplay all the employees
details along with emp code and name in next rows
sample data file attached
Last edited by koolguys4u; 06-21-2009 at 03:10 AM.
Use a Pivot Table, set:
PAGE Field: Project Code
ROW Field 1: Name
ROW Field 2: EmpCode
(no need to populate Data Field but if you wanted you could add Name to that Field, it will default to COUNT)
You can then filter the results of Name & EmpCode by altering the selection made in the PAGE Field (Project Code)
My Recommended Reading:
Volatility
Sumproduct & Arrays
Pivot Intro
Email from XL - VBA & Outlook VBA
Function Dictionary & Function Translations
Dynamic Named Ranges
Hi KoolGuy. This technique uses an array function, so any changes you make to the formula in column A, be sure to confirm them by pressing CTRL-SHIFT-ENTER. Once the first value appears properly, then you can copy the formula down a ways.
In A3:
=IF(ROW()-2>$C$1,"",INDEX(Sheet1!$A$1:$A$100,SMALL(IF(Sheet1!$C$1:$C$100=$B$1,ROW($A$1:$A$100),""),ROW()-2)))
Last edited by JBeaucaire; 06-20-2009 at 09:25 AM. Reason: Sheet removed...see below for latest version
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Thanks for your prompt reply,
One more thing i forgot to mention that If i entered the Wrong Project Code or Invalid Project code it will give the messg that Invalid Project Code ...
Thanks once again for prompt reply to both of you....
Put this replacement formula in C1:
=IF(COUNTIF(Sheet1!C:C,B1)=0,"Wrong Code",COUNTIF(Sheet1!C:C,B1))
And this replacement array formula in A3:
=IF(OR($C$1="wrong code",ROW()-2>$C$1),"",INDEX(Sheet1!$A$1:$A$100,SMALL(IF(Sheet1!$C$1:$C$100=$B$1,ROW($A$1:$A$100),""),ROW()-2)))
Thank you once again for reply.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks