Creating a list based on cell contents

scotthannaford1973

Board Regular
Joined
Sep 27, 2017
Messages
110
Office Version
  1. 2010
Platform
  1. Windows
Hi all

okay hope you can help here... A3:G15 shows a list of projects and project teams; if they are involved in a project in a particular month, there is a 1 beside the team name for that month; if not, there is a 0.

Cell J1 is a drop-down where I can specify the team; what I'd like is that below each month (I3:L3) to list all of the projects where the Team's involvement = 1 and its a dynamic list depending on what's in J1

for example, in J (Jan-21), with Support selected, there would be a list of Project A and Project B

No idea how to do this, so any pointers gratefully received!

ABCDEFGHIJKL
1Team nameSupport
2
3Project NameTeam NameDec-20Jan-21Feb-21Mar-21Dec-20Jan-21Feb-21Mar-21
4Project ATraining1010
5Project ADev1000
6Project ASupport1111
7Project ATesting1100
8Project BTraining1000
9Project BDev1111
10Project BSupport1100
11Project BTesting1000
12Project CTraining1111
13Project CDev1100
14Project CSupport1010
15Project CTesting1010
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
What version of Excel are you using?
Please update your account details to show this, as it affects which functions you can use.
 
Upvote 0
is that what you want?
Team NameSupport
AttributeJan-21
Project Name
Project A
Project B
 
Upvote 0
I am not sure about the column numbers. I tried to guess whether you actually use column A for line numbers or if your project names are in column A. I wrote the code assuming the project names were in column A. If I guesses wrong the code fails and will need to be tweaked.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
Application.EnableEvents = False
Dim c As Range, i As Long
    If Target.Address = "$J$1" Then
        For Each c In Range("B4", Cells(Rows.Count, 2).End(xlUp))
            If c.Value = Target.Value Then
                For i = 3 To 6
                    If Cells(c.Row, i) = 1 Then
                        Cells(c.Row, i + 5) = c.Offset(, -1).Value
                    End If
                Next
            End If
        Next
    End If
Application.EnableEvents = True
End Sub
 
Upvote 0
this is the results using the code in post# 4.

Discussions.xlsm
ABCDEFGHIJK
1Team nameTraining
2
3Project NameTeam Name20-Dec21-Jan21-Feb21-Mar20-Dec21-Jan21-Feb21-Mar
4Project ATraining1010Project AProject A
5Project ADev1000
6Project ASupport1111
7Project ATesting1100
8Project BTraining1000Project B
9Project BDev1111
10Project BSupport1100
11Project BTesting1000
12Project CTraining1111Project CProject CProject CProject C
13Project CDev1100
14Project CSupport1010
15Project CTesting1010
Sheet1
 
Upvote 0
or
Team NameSupport
Attribute
Dec-20Feb-21Jan-21Mar-21
TeamProject A, Project B, Project CProject A, Project CProject A, Project BProject A
 
Upvote 0
Try
In 'I4' cell ARRAY formula below (finshed with Ctrl+Shift+Enter), copy across
Sorted Z-A
Code:
=IF(ROWS($I$4:I4)>SUMPRODUCT(($C$4:$G$15=1)*($C$4:$C$15=$J$1)*($C$3:$G$3=I$3)),"",INDEX($B$4:$B$15,SUMPRODUCT(LARGE(($C$4:$G$15=1)*($C$4:$C$15=$J$1)*($C$3:$G$3=I$3)*(ROW($C$4:$G$15)-ROW(C$4:G$4)+1),ROWS($I$4:I4)))))
Then Sorted A-Z
In 'N4' cell ARRAY formula below (finshed with Ctrl+Shift+Enter), copy across
Code:
=IFERROR(INDEX(I$4:I$15,LARGE(IF(I$4:I$15<>"",ROW(I$4:I$15)-MIN(ROW(I$4:I$15))+1,""),ROWS(N$3:N3))),"")
 

Attachments

  • scotthannaford1973.png
    scotthannaford1973.png
    14.7 KB · Views: 10
Upvote 0
Two other options depending of your version
+Fluff v2.xlsm
ABCDEFGHIJKL
1Team nameSupport
2
3Project NameTeam NameDec-20Jan-21Feb-21Mar-21Dec-20Jan-21Feb-21Mar-21
4Project ATraining1010Project AProject AProject AProject A
5Project ADev1000Project BProject BProject C
6Project ASupport1111Project C
7Project ATesting1100
8Project BTraining1000
9Project BDev1111Project AProject AProject AProject A
10Project BSupport1100Project BProject BProject C 
11Project BTesting1000Project C   
12Project CTraining1111    
13Project CDev1100
14Project CSupport1010
15Project CTesting1010
16
Main
Cell Formulas
RangeFormula
I4:I6,L4,J4:K5I4=FILTER($B$4:$B$15,($C$4:$C$15=$J$1)*(FILTER($D$4:$G$15,$D$3:$G$3=I3)=1))
I9:L12I9=IFERROR(INDEX($B$4:$B$15,AGGREGATE(15,6,(ROW($B$4:$B$15)-ROW($B$4)+1)/($C$4:$C$15=$J$1)/($D$3:$G$3=I$3)/($D$4:$G$15=1),ROWS(I$9:I9))),"")
Dynamic array formulas.
 
Upvote 0
Try
In 'I4' cell ARRAY formula below (finshed with Ctrl+Shift+Enter), copy across
Sorted Z-A
Code:
=IF(ROWS($I$4:I4)>SUMPRODUCT(($C$4:$G$15=1)*($C$4:$C$15=$J$1)*($C$3:$G$3=I$3)),"",INDEX($B$4:$B$15,SUMPRODUCT(LARGE(($C$4:$G$15=1)*($C$4:$C$15=$J$1)*($C$3:$G$3=I$3)*(ROW($C$4:$G$15)-ROW(C$4:G$4)+1),ROWS($I$4:I4)))))
Then Sorted A-Z
In 'N4' cell ARRAY formula below (finshed with Ctrl+Shift+Enter), copy across
Code:
=IFERROR(INDEX(I$4:I$15,LARGE(IF(I$4:I$15<>"",ROW(I$4:I$15)-MIN(ROW(I$4:I$15))+1,""),ROWS(N$3:N3))),"")
thanks - that works like a dream
Try
In 'I4' cell ARRAY formula below (finshed with Ctrl+Shift+Enter), copy across
Sorted Z-A
Code:
=IF(ROWS($I$4:I4)>SUMPRODUCT(($C$4:$G$15=1)*($C$4:$C$15=$J$1)*($C$3:$G$3=I$3)),"",INDEX($B$4:$B$15,SUMPRODUCT(LARGE(($C$4:$G$15=1)*($C$4:$C$15=$J$1)*($C$3:$G$3=I$3)*(ROW($C$4:$G$15)-ROW(C$4:G$4)+1),ROWS($I$4:I4)))))
Then Sorted A-Z
In 'N4' cell ARRAY formula below (finshed with Ctrl+Shift+Enter), copy across
Code:
=IFERROR(INDEX(I$4:I$15,LARGE(IF(I$4:I$15<>"",ROW(I$4:I$15)-MIN(ROW(I$4:I$15))+1,""),ROWS(N$3:N3))),"")
 
Upvote 0
thanks all - some great suggestions there - works like a dream

=IF(ROWS($I$4:I4)>SUMPRODUCT(($C$4:$G$15=1)*($C$4:$C$15=$J$1)*($C$3:$G$3=I$3)),"",INDEX($B$4:$B$15,SUMPRODUCT(LARGE(($C$4:$G$15=1)*($C$4:$C$15=$J$1)*($C$3:$G$3=I$3)*(ROW($C$4:$G$15)-ROW(C$4:G$4)+1),ROWS($I$4:I4)))))
 
Upvote 0

Forum statistics

Threads
1,214,861
Messages
6,121,973
Members
449,059
Latest member
oculus

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