TEXTBEFORE not working in the FILTER function

TheColonist

New Member
Joined
Jun 23, 2023
Messages
11
Office Version
  1. 365
Platform
  1. Windows
I work for a school for the blind and visually impaired. Every 2 weeks we get a new schedule. The first figure is an example of the schedule table. Most of the instructors are blind. This is cumbersome to navigate with a screen reader.

I created another worksheet for the instructors, Figure 2. I use the following formula to list the students and the class they are attending.

The formula below returns the student's first name from the "First" column and the last three letters of the Class in P1 if the first 4 characters in P1 = the first 4 characters of the instructor's name, which is a column header, in Figure 2. It works great, but some instructors may only have 2 or 3 letters in their first name, such as Al, or Don. Right now, I add characters to make the formula work and distinguish instructors that may have the same first 4 characters.

=TEXTJOIN(", ",1,FILTER(AT_VISP[First]&TEXTAFTER(AT_VISP[P1],"-"),

LEFT(AT_VISP[P1],4)=LEFT(Table36[[#Headers],[Randy]],4),""))

I tried the following formula, but I get a #NA error. Obviously, TEXTAFTER works in the FILTER function, but I can't get TEXTBEFORE to work.

=TEXTJOIN(", ",1,FILTER(AT_VISP[First]&TEXTAFTER(AT_VISP[P1],"-"),

TEXTBEFORE(AT_VISP[P1],"-")=Table36[[#Headers],[Randy]],""))

Any ideas why TEXTBEFORE isn’t working?

Fig. 1
Schedule Forum.png

Fig. 2
Instructors Schedule Forum.png
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
=TEXTJOIN(", ",1,FILTER(AT_VISP[First]&TEXTAFTER(AT_VISP[P1],"-"),TEXTBEFORE(AT_VISP[P1],"-",,,"")=Table36[[#Headers],[Randy]],""))
 
Upvote 0
WOW!! It worked! I'm familiar with the LET function, but I will investigate it and look over the formula you sent. Thanks! this is one heck of a forum.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

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