Divide students by first letter of last name?

charlesstricklin

Board Regular
Joined
May 6, 2013
Messages
98
Office Version
  1. 2021
Platform
  1. Windows
The school where I teach has two Vice-Principals. All of our 7th grade students go to one or the other based on the first letter of the last name.

Students with first letters of last names beginning with the range A-K go to one Vice-Principal, and the L-Z students goes to the other.

How may I display which one handles each student?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
CT,

The formula below checks the universal number associated with the first letter of the last name. This accounts for both upper case and lower case. The "VP1" and "VP2" will be your Vice Principle names. Finally, if the Students last name does not begin with a letter from the English alphabet the formula will return "Not a Letter".

=IF(OR(AND(UNICODE(A1)>=65,UNICODE(A1)<=75),AND(UNICODE(A1)>=97,UNICODE(A1)<=107)),"VP1",IF(OR(AND(UNICODE(A1)>=76,UNICODE(A1)<=90),AND(UNICODE(A1)>=108,UNICODE(A1)<=122)),"VP2","NOT A LETTER"))
 
Upvote 0
what does your data look like? are the names all in one column like "John Smith" or "Smith, John" or are first and last names in separate columns?
 
Upvote 0
Hi,

fhqwgads has a valid question, but assuming you have Last Name in a separate cell OR Last Name First Name in the Same cell, you can use this, otherwise, please clarify your data/name format:


Book1
AB
1Name format?
2Doe, JohnVP1
3smithVP2
4JohnsonVP1
5good, JohnnyVP1
6JacksonVP1
7RobertsVP2
8WilsonVP2
9YoungVP2
Sheet312
Cell Formulas
RangeFormula
B2=IF(AND(CODE(UPPER(A2))>=65,CODE(UPPER(A2))<=75),"VP1",IF(AND(CODE(UPPER(A2))>=76,CODE(UPPER(A2))<=90),"VP2",""))


Formula copied down.
 
Upvote 0
Thanks! That's perfect.
What was? - there has been more than 1 suggestion.
What does your data actually look like?
If Last name is listed in a separate cell or first in a combined cell, as far as I can see all you should need is

Excel Workbook
AB
2Doe, JohnVP1
3Smith, JennyVP2
4Johnson, TimVP1
5Good, JohnnyVP1
6Jackson, JamesVP1
7Roberts, RobVP2
8Wilson, AnnVP2
9Young, KimVP2
VP
 
Last edited:
Upvote 0
Thanks! That's perfect.

Don't know which you're referring to, but I'd like to amend my formula in Post # 4 to this in case of Blank rows:


Book1
AB
1Name format?
2Doe, JohnVP1
3smithVP2
4# of students
5JohnsonVP1
6good, JohnnyVP1
7
8JacksonVP1
9RobertsVP2
10% of students
11WilsonVP2
12YoungVP2
Sheet312
Cell Formulas
RangeFormula
B2=IF(A2="","",IF(AND(CODE(UPPER(A2))>=65,CODE(UPPER(A2))<=75),"VP1",IF(AND(CODE(UPPER(A2))>=76,CODE(UPPER(A2))<=90),"VP2","")))
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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