Solved

Return first occurence of match, return the next match on next occurence

Posted on 2016-10-21
6
32 Views
Last Modified: 2016-11-12
I have attached a spreadsheet here to demonstrate what I'm trying to do.


I have a list, with a department number and an employee name on one spreadsheet.  More than one employee may work in a department.  

I need to have each person who matches a department show up , I've tried a Vlookup formula however this only returns the first person,  I also tried a match formula,  any assistance would be greatly appreciated!
Test-Payroll-Automation.xlsx
0
Comment
Question by:jgreenlee01
  • 3
  • 3
6 Comments
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 41854716
use this formula, it is array formula so enter it with special key stroke of Control + Shift +Enter

see attached

=IFERROR(INDEX(Sheet2!$B$2:$B$9,SMALL(IF(Sheet1!B9=Sheet2!$A$2:$A$9,ROW(Sheet2!$B$2:$B$9)-ROW(Sheet2!$B$2)+1),ROWS(Sheet2!$A$2:A2))),"")
Test-Payroll-Automation.xlsx
0
 

Author Comment

by:jgreenlee01
ID: 41854726
Hi Professor JimJam,

Thank you,  

When I apply this solution to the larger spreadsheet I am not getting the right names produced by the formula.  A random name appears to show up.  What could I be misapplying?
0
 

Author Comment

by:jgreenlee01
ID: 41854734
This is what my formula looks like when converted to work for the larger spreadsheet

=IFERROR(INDEX('ADP Hours Worked by Dept Report'!B:B,SMALL(IF(B13='ADP Hours Worked by Dept Report'!A:A,ROW('ADP Hours Worked by Dept Report'!B:B)-ROW('ADP Hours Worked by Dept Report'!$B$2)+1),ROWS('ADP Hours Worked by Dept Report'!$A$2:A2))),"")
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

Author Comment

by:jgreenlee01
ID: 41856258
On the test sheet that is attached to the original question, the return appears to be 0 with the Ctrl Shift Enter.
0
 
LVL 26

Accepted Solution

by:
ProfessorJimJam earned 500 total points (awarded by participants)
ID: 41856782
put this formula in C9 and copy down

=IFERROR(INDEX(MyData[Payroll Name],SMALL(IF('Main Street'!B9=MyData[Worked In Department],ROW(MyData[Payroll Name])-ROW('ADP Hours Worked by Dept Report'!$B2)+1),COUNTIF('Main Street'!$B$9:$B9,'Main Street'!$B9))),"")
0
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 41884547
.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question