Create a list based on the value of a cell

jc352

Board Regular
Joined
Aug 13, 2008
Messages
139
Office Version
  1. 365
Platform
  1. Windows
I am trying to create a list in row E based on the information in row C. If C=Blue I want the it in the list. If something repeats I want it included in the new list.

The new list in in row E would be 1234, 1234 and 8518

ABC
1234Jones, SamBlue
1234Jones, SamBlue
8341Brown, AdamGreen
8518Smith, JohnBlue
6541Mills, DanOrange

<tbody>
</tbody>
 
Would it be possible to adjust the formula to include anthing with word 'blue' in it from column C? Still listing the following values from Column A (1234, 1234, 8518) in Column E.

ABC
1234Blue
1234Blue-LT
8341Green
8518Blue-DK
6541Orange

<TBODY>
</TBODY>
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Would it be possible to adjust the formula to include anthing with word 'blue' in it from column C? Still listing the following values from Column A (1234, 1234, 8518) in Column E.

ABC
1234Blue
1234Blue-LT
8341Green
8518Blue-DK
6541Orange

<tbody>
</tbody>

E1,just enter:
Rich (BB code):
=COUNTIF($C$2:$C$6,"*Blue*")

E2, control+shift+enter, not just enter:
Rich (BB code):
=IF(ROWS(E$2:E2)<=E$1,INDEX($A$2:$A$6,
  SMALL(IF(ISNUMBER(SEARCH("Blue",$C$2:$C$6)),
  ROW($A$2:$A$6)-ROW($A$2)+1),ROWS(E$2:E2))),"")
 
Upvote 0
Thank you for your help with this. I have one more request. Is it possible to adjust the formula to have the return in Column E be based on how the items in Column C fall alphabetically? So Column E would read 1234, 8518 and 1234 based on Blue, Blue-DK and Blue-LT.
 
Upvote 0
Thank you for your help with this. I have one more request. Is it possible to adjust the formula to have the return in Column E be based on how the items in Column C fall alphabetically? So Column E would read 1234, 8518 and 1234 based on Blue, Blue-DK and Blue-LT.

Well, why not indeed?..
X Y Blue #Sorted#
1234 Blue 3 Blue
1234 Blue-LT Result ListIdxBlue-DK
8341 Green 12341Blue-LT
8518 Blue-DK 85182Green
6541 Orange 12343Orange

<colgroup><col style="width: 60pt; mso-width-source: userset; mso-width-alt: 2844;" width="80"> <col style="width: 67pt; mso-width-source: userset; mso-width-alt: 3185;" width="90"> <col style="width: 71pt; mso-width-source: userset; mso-width-alt: 3356;" width="94"> <col style="width: 48pt;" width="64"> <col style="width: 78pt; mso-width-source: userset; mso-width-alt: 3697;" span="2" width="104"> <col style="width: 75pt; mso-width-source: userset; mso-width-alt: 3555;" width="100"> <tbody>
</tbody>

E1: Blue (a search string of interest)

E2, just enter:
Rich (BB code):
=COUNTIF($C$2:$C$6,"*"&E$1&"*")

E4, just enter and copy down:
Rich (BB code):
=IF($F4="","",INDEX($A$2:$A$6,MATCH(INDEX($G$2:$G$6,$F4),$C$2:$C$6,0)))

F4, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF(ROWS(F$4:F4)<=E$2,SMALL(IF(ISNUMBER(SEARCH(E$1,$G$2:$G$6)),
  ROW($G$2:$G$6)-ROW($G$2)+1),ROWS(E$4:E4)),"")

G1: #Sorted#

G2, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IF(ROWS(G$2:G2)<=ROWS($C$2:$C$6),INDEX($C$2:$C$6,
  MATCH(0,COUNTIF($C$2:$C$6,"<"&$C$2:$C$6)-(SUM(IF($C$2:$C$6="",1))>0)-
  SUM(COUNTIF($C$2:$C$6,"="&G$1:G1)),0)),"")

Note 1. I hope the latter formula is accepted by a pre-2007 system like yours.

Note 2. This fomula modifies a sorting formula in an important way for empty/blank cells.
 
Upvote 0
Just wanted to bump this thread and say thanks. This is a really neat solution to a problem that I was trying to solve. It's been a while since being on the forum but Mr Excel does it again...
 
Upvote 0

Forum statistics

Threads
1,216,134
Messages
6,129,070
Members
449,485
Latest member
greggy

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