INDEXING ROWS for multiple criteria

cmholmes

New Member
Joined
May 13, 2013
Messages
30
Hello,

I'm trying to work through a formula for indexing rows based on 3 criteria. This is the what the data dumb looks like:

EmployeeIDFirstNameLastNameLocationJobTitleDeptCode
1johnsmithFLSales Associate101
2samanthajonesFLSales Associate101
3jamesclarkFLSales Manager101
4justinebakerCAPresident105
5sarahmillerTXSales Associate101

<tbody>
</tbody>

I am setting up a worksheet that has a set number of Job Titles for each location and department and I'm trying to set up a way to index those that are currently employed and leave a blank for any position that needs to be filled. So the Result would look like this:


EmployeeIDFirstNameLastNameLocationJobTitleDeptCode
1johnsmithFLSales Associate101
2samantnajonesFLSales Associate101
---FLSales Associate101
3jamesclarkFLSales Manager101
4justinebakerCAPresident105
5sarahmillerTXSales Associate101
---TXSales Associate101
---TXSales Associate101
---TXSales Manager101

<tbody>
</tbody>


The Locations, Job Titles and DeptCodes are set(hard coded) and the EmployeeID, First Name and LastName would be INDEXed from the data sheet.

I've tried using a IF-INDEX formula that references the columns as defined names but I couldn't get the formula to extend past one Locations, Job Titles and DeptCodes type.
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
So this formula is working pretty well but it is not capturing all of the data. This is the formula I have in the first cell of the EmployeeID Column.

"{=IF(COUNTIFS(D$10:D10,$D10,E$10:E10,$E10,F$10:F10,$F10)<=COUNTIFS('Data'!$D:$D,$D10,'Salary Raw'!$E:$E,$F10,'Data'!$F:$F,$E10),INDEX(INDIRECT(A$9),SMALL(IF(Location=$D10,IF(JobTitle=$E10,IF(DeptCode=$F10,ROW(EmployeeId)-ROW('Data'!$D$6)+1))),COUNTIFS(D$10:D10,$D10,E$10:E10,$E10,F$10:F10,$F10))),"-")}"
 
Upvote 0
This works, I double checked.

So this formula is working pretty well but it is not capturing all of the data. This is the formula I have in the first cell of the EmployeeID Column.

"{=IF(COUNTIFS(D$10:D10,$D10,E$10:E10,$E10,F$10:F10,$F10)<=COUNTIFS('Data'!$D:$D,$D10,'Salary Raw'!$E:$E,$F10,'Data'!$F:$F,$E10),INDEX(INDIRECT(A$9),SMALL(IF(Location=$D10,IF(JobTitle=$E10,IF(DeptCode=$F10,ROW(EmployeeId)-ROW('Data'!$D$6)+1))),COUNTIFS(D$10:D10,$D10,E$10:E10,$E10,F$10:F10,$F10))),"-")}"
 
Upvote 0

Forum statistics

Threads
1,214,605
Messages
6,120,473
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top