Generate a list from array based on two conditions

areemjee

New Member
Joined
Jan 20, 2021
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
Hi guys, I am trying to generate a list (from cell J5 and below) based on an employee's role (cell J2) and whether there is a value in any of the KPI components associated to that role.

This is the function that I currently have in cells J5:J15. I cannot figure out a way to look up the column based on the role in cell J2.

Any help would be appreciated. TIA

Excel Formula:
=IFERROR((INDEX($A$5:$A$15,SMALL(IF($B$5:$B$15>0,ROW($A$5:$A$15)-ROW($A$5)+1),ROWS($B$5:B5)))),"")


1611131068214.png
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Welcome to MrExcel Message Board.
Try this:
Book1
ABCDEFGHIJKL
1
2Role NO.Role2
3
4KPI ComponentRole1Role2Role3Role4Role5Role6PointsModified Formula
5KPI15%KPI1KPI2
6KPI25%5%5%KPI3KPI3
7KPI35%5%5%5%5%KPI4KPI4
8KPI45%5%5%5%5%KPI5KPI7
9KPI55%5%5%5% KPI8
10KPI65%5%  
11KPI75%5%5%  
12KPI85%5%5%  
13KPI95%5%5%  
14KPI105%5%  
15KPI115%  
16KPI125%  
17
Sheet1
Cell Formulas
RangeFormula
J5:J16J5=IFERROR((INDEX($A$5:$A$15,SMALL(IF($B$5:$B$15>0,ROW($A$5:$A$15)-ROW($A$5)+1),ROWS($B$5:B5)))),"")
K5:K16K5=IFERROR((INDEX($A$5:$A$15,SMALL(IF(OFFSET($B$5,0,MATCH($J$2,$B$4:$G$4,0)-1,11,1)>0,ROW($A$5:$A$15)-ROW($A$5)+1),ROWS($B$5:B5)))),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Solution
Welcome to MrExcel Message Board.
Try this:
Book1
ABCDEFGHIJKL
1
2Role NO.Role2
3
4KPI ComponentRole1Role2Role3Role4Role5Role6PointsModified Formula
5KPI15%KPI1KPI2
6KPI25%5%5%KPI3KPI3
7KPI35%5%5%5%5%KPI4KPI4
8KPI45%5%5%5%5%KPI5KPI7
9KPI55%5%5%5% KPI8
10KPI65%5%  
11KPI75%5%5%  
12KPI85%5%5%  
13KPI95%5%5%  
14KPI105%5%  
15KPI115%  
16KPI125%  
17
Sheet1
Cell Formulas
RangeFormula
J5:J16J5=IFERROR((INDEX($A$5:$A$15,SMALL(IF($B$5:$B$15>0,ROW($A$5:$A$15)-ROW($A$5)+1),ROWS($B$5:B5)))),"")
K5:K16K5=IFERROR((INDEX($A$5:$A$15,SMALL(IF(OFFSET($B$5,0,MATCH($J$2,$B$4:$G$4,0)-1,11,1)>0,ROW($A$5:$A$15)-ROW($A$5)+1),ROWS($B$5:B5)))),"")
Press CTRL+SHIFT+ENTER to enter array formulas.
Works perfectly, thank you :)
 
Upvote 0

Forum statistics

Threads
1,215,618
Messages
6,125,870
Members
449,266
Latest member
davinroach

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