extract all name if certain cell has certain Text

hajiali

Well-known Member
Joined
Sep 8, 2018
Messages
626
Office Version
  1. 2016
Platform
  1. Windows
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[TD]J[/TD]
[TD]K[/TD]
[TD]L[/TD]
[TD]M[/TD]
[TD]N[/TD]
[TD]O[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]NAME[/TD]
[TD]SUNTIME[/TD]
[TD]SUNP0S[/TD]
[TD]MONTIME[/TD]
[TD]MONP0S[/TD]
[TD]TUETIME[/TD]
[TD]TUEPOS[/TD]
[TD]WEDTIME[/TD]
[TD]WEDPOS[/TD]
[TD]THUTIME[/TD]
[TD]THUPOS[/TD]
[TD]FRITME[/TD]
[TD]FRIPOS[/TD]
[TD]SATTIME[/TD]
[TD]SATPOS[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]JOHN
[/TD]
[TD]4-12[/TD]
[TD]POS1
[/TD]
[TD]4-12[/TD]
[TD]POS4[/TD]
[TD]4-12[/TD]
[TD]POS4[/TD]
[TD]4-12[/TD]
[TD]POS4[/TD]
[TD]4-12[/TD]
[TD]POS4[/TD]
[TD]4-12[/TD]
[TD]POS4[/TD]
[TD]4-12[/TD]
[TD]POS1[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]BILL[/TD]
[TD]6-15[/TD]
[TD]POS2
[/TD]
[TD]6-15[/TD]
[TD]POS1[/TD]
[TD]6-15[/TD]
[TD]EXTRA[/TD]
[TD]6-15[/TD]
[TD]EXTRA[/TD]
[TD]6-15[/TD]
[TD]EXTRA[/TD]
[TD]6-15[/TD]
[TD]EXTRA[/TD]
[TD]6-15[/TD]
[TD]POS2[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]TOM[/TD]
[TD]14-23
[/TD]
[TD]POS3[/TD]
[TD]14-23[/TD]
[TD]POS2[/TD]
[TD]14-23[/TD]
[TD]POS1[/TD]
[TD]14-23[/TD]
[TD]EXTRA[/TD]
[TD]14-23[/TD]
[TD]EXTRA[/TD]
[TD]14-23[/TD]
[TD]EXTRA[/TD]
[TD]14-23[/TD]
[TD]POS3[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]PETER[/TD]
[TD]15-00[/TD]
[TD]EXTRA[/TD]
[TD]15-00[/TD]
[TD]EXTRA[/TD]
[TD]15-00[/TD]
[TD]EXTRA[/TD]
[TD]15-00[/TD]
[TD]POS1[/TD]
[TD]15-00[/TD]
[TD]POS3[/TD]
[TD]15-00[/TD]
[TD]POS3[/TD]
[TD]15-00[/TD]
[TD]EXTRA[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]MARK[/TD]
[TD]7-17[/TD]
[TD]EXTRA[/TD]
[TD]7-17[/TD]
[TD]EXTRA[/TD]
[TD]7-17[/TD]
[TD]POS3[/TD]
[TD]7-17[/TD]
[TD]POS2[/TD]
[TD]7-17[/TD]
[TD]POS1[/TD]
[TD]7-17[/TD]
[TD]POS2[/TD]
[TD]7-17[/TD]
[TD]EXTRA[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]MATT[/TD]
[TD]4-12[/TD]
[TD]POS4[/TD]
[TD]4-12[/TD]
[TD]EXTRA[/TD]
[TD]4-12[/TD]
[TD]EXTRA[/TD]
[TD]4-12[/TD]
[TD]POS3[/TD]
[TD]4-12[/TD]
[TD]POS2[/TD]
[TD]4-12[/TD]
[TD]POS1[/TD]
[TD]4-12[/TD]
[TD]POS4[/TD]
[/TR]
</tbody>[/TABLE]

above table I have names and shift (in Red) next to each shift is a position that each employee will work. to the Right of the table COLUMN P1 I will put days of week (ex: "SUNDAY", "MONDAY", ETC.) below that I want it to pull all the names of employees that are "EXTRA"


TABLE SHOULD READ FOR MONDAY
[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]P[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]MONDAY[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]PETER
[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]MARK[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]MATT[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

If i typed TUESDAY than list should be: BILL, PETER, MATT

any suggestions kindly appreciated it.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
Ok, you missed a bit when changing the formula, it should be
=IFERROR(INDEX(BID!$A$5:$A$434,SMALL(IF(INDEX(BID!$A$5:$P$434,,MATCH(TEXT(C1,"ddd")&"POS",BID!$A$4:$P$4,0))="EXTRA",ROW(BID!$A$5:$A$434)-ROW(BID!$A$5)+1),ROWS(BID!$A$4:A4))),"")
 
Last edited:
Upvote 0
OMG one step closer to the result. First results captures all the first for each day. The 2nd result is blank and the 3rd result is not the correct name to be second on the list for any days. form 4th result to end are all blank.
 
Upvote 0
You also need to "fix" C1 like
TEXT($C$1,"ddd")
 
Upvote 0
Much Appreciated Fluff AMAZING job troubleshooting this with me.
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
So with the results next cell over i would like to put the shift for each of those Extra Employees. the shift might me different on each day. how would i change the formula to pull the Time for each of the names it pulled.
 
Upvote 0
Are the shifts to the left or right of the cells with "Extra"?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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