+ Reply to Thread
Results 1 to 6 of 6

If i entered any project code in sheet2 display all data of that project

  1. #1
    Registered User
    Join Date
    06-07-2009
    Location
    UAE
    MS-Off Ver
    Excel 2003
    Posts
    61

    If i entered any project code in sheet2 display all data of that project

    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
    Attached Files Attached Files
    Last edited by koolguys4u; 06-21-2009 at 03:10 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: If i entered any project code in sheet2 display all data of that project

    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)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: If i entered any project code in sheet2 display all data of that project

    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!)

  4. #4
    Registered User
    Join Date
    06-07-2009
    Location
    UAE
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: If i entered any project code in sheet2 display all data of that project

    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....

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: If i entered any project code in sheet2 display all data of that project

    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)))
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-07-2009
    Location
    UAE
    MS-Off Ver
    Excel 2003
    Posts
    61

    Re: If i entered any project code in sheet2 display all data of that project

    Thank you once again for reply.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1