List cells with "YES" Value

surkdidat

Active Member
Joined
Oct 1, 2011
Messages
361
Hi all

In Row 1 I have the heading names i.e AAA BBB CCC DDD etc
What I would like in column P, it looks at that the cell value, and if there is a yes. it lists it in column P
So :-

Code:
 -----L---- | -----M---- | -----N---- | -----O---- | -----P---- | 
----AAA--- | ---BBB--- | ---CCC--- | ---DDD--- | ANSWER-| 

--- YES----|-----YES---|-----NO----|------NO---| AAA BBB  |
-----NO----|-----NO----|-----NO----|-----NO----| (no value) |
-----NO----|-----YES---|-----NO----|-----NO----| ----BBB--- |
-----NO----|-----YES---|-----NO----|----YES----| BBB DDD   |
 

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

JackDanIce

Well-known Member
Joined
Feb 3, 2010
Messages
9,683
Office Version
  1. 365
Platform
  1. Windows
Not sure this is do-able with standard Excel, do you mean with a macro?

If so, what is the name of the sheet the data is on and what column defines the last row of data?
 

wideboydixon

Well-known Member
Joined
Jun 2, 2016
Messages
3,401
Excel 2016 solution:

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>L</th><th>M</th><th>N</th><th>O</th><th>P</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">AAA</td><td style=";">BBB</td><td style=";">CCC</td><td style=";">DDD</td><td style=";">ANSWER</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">YES</td><td style=";">YES</td><td style=";">NO</td><td style=";">NO</td><td style=";">AAA BBB</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style=";">NO</td><td style=";">NO</td><td style=";">NO</td><td style=";">NO</td><td style=";"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style=";">NO</td><td style=";">YES</td><td style=";">NO</td><td style=";">NO</td><td style=";">BBB</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style=";">NO</td><td style=";">YES</td><td style=";">NO</td><td style=";">YES</td><td style=";">BBB DDD</td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Array Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">P2</th><td style="text-align:left">{=TRIM(<font color="Blue">CONCAT(<font color="Red">IF(<font color="Green">$L2:$O2="YES",$L$1:$O$1&" ",""</font>)</font>)</font>)}</td></tr></tbody></table><b>Entered with Ctrl+Shift+Enter.</b> If entered correctly, Excel will surround with curly braces {}.
<b>Note: Do not try and enter the {} manually yourself</b></td></tr></table><br />

Previous versions:

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>L</th><th>M</th><th>N</th><th>O</th><th>P</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style=";">AAA</td><td style=";">BBB</td><td style=";">CCC</td><td style=";">DDD</td><td style=";">ANSWER</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">2</td><td style=";">YES</td><td style=";">YES</td><td style=";">NO</td><td style=";">NO</td><td style=";">AAA BBB</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">3</td><td style=";">NO</td><td style=";">NO</td><td style=";">NO</td><td style=";">NO</td><td style=";"></td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">4</td><td style=";">NO</td><td style=";">YES</td><td style=";">NO</td><td style=";">NO</td><td style=";">BBB</td></tr><tr ><td style="color: rgb(22,17,32);text-align: center;">5</td><td style=";">NO</td><td style=";">YES</td><td style=";">NO</td><td style=";">YES</td><td style=";">BBB DDD</td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">P2</th><td style="text-align:left">=TRIM(<font color="Blue">IF(<font color="Red">$L2="YES",$L$1&" ",""</font>)&IF(<font color="Red">$M2="YES",$M$1&" ",""</font>)&IF(<font color="Red">$N2="YES",$N$1&" ",""</font>)&IF(<font color="Red">$O2="YES",$O$1&" ",""</font>)</font>)</td></tr></tbody></table></td></tr></table><br />

WBD
 

surkdidat

Active Member
Joined
Oct 1, 2011
Messages
361
Excellent. That's going into my collection, very useful!! :) :) :)

Excel 2016 solution:

LMNOP
1AAABBBCCCDDDANSWER
2YESYESNONOAAA BBB
3NONONONO
4NOYESNONOBBB
5NOYESNOYESBBB DDD

<colgroup><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Array Formulas
CellFormula
P2{=TRIM(CONCAT(IF($L2:$O2="YES",$L$1:$O$1&" ","")))}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



Previous versions:

LMNOP
1AAABBBCCCDDDANSWER
2YESYESNONOAAA BBB
3NONONONO
4NOYESNONOBBB
5NOYESNOYESBBB DDD

<colgroup><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
P2=TRIM(IF($L2="YES",$L$1&" ","")&IF($M2="YES",$M$1&" ","")&IF($N2="YES",$N$1&" ","")&IF($O2="YES",$O$1&" ",""))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>



WBD
 

Watch MrExcel Video

Forum statistics

Threads
1,108,766
Messages
5,524,772
Members
409,600
Latest member
Dunnowhatfor

This Week's Hot Topics

Top