Yield name based off last digit(s) of number

Seph

New Member
Joined
Jan 28, 2012
Messages
9
Office Version
  1. 2019
Platform
  1. Windows
I'm a Parole Supervisor and each month we have a docket of inmates to see the Parole Board. I have three Parole Agents preparing the cases for each month. They are assigned cases based of the inmate's number. Each inmate number starts with two letters and ends with four numbers (NU3644). Mandy is assigned cases based on the inmate number that ends in 1, 2, or 3. Matt is assigned cases based on the inmate number that ends in 4, 5, or 6, and Donna is assigned cases based on the inmate number that ends in 7, 8 or 9. However, many inmate numbers end in zero. In that instance it goes by the preceding number until a positive integer is located. For instance MS3000 would be Mandy's case, and NU3050 would be Matt's case.

I need a formula that would yield the agent's name based off the last digit or in the case of zero the preceding digit(s) of the inmate number.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)
 
Upvote 0
Upvote 0
Solution
You all never cease to amaze me. I know this is probably second nature to you, but I would have never got that formula even with trial and error.

Thanks!!!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,194
Members
452,616
Latest member
intern444

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