Fill in data base on entry

JTL9161

Well-known Member
Joined
Aug 29, 2012
Messages
582
Office Version
  1. 365
Platform
  1. Windows
I am trying to find a formula that will fill in a number based on where a name is entered. As a name is entered, I need the number where the name is entered to fill in on a table.

Thanks,
James

Book1
ABCDEFGH
1
2User enters names here
31DAVEBILL
41BOBGREG
52TOMTIM
62STEVEBRIAN
73GEORGEBRYAN
83MIKEDOUG
94STUED
104RICKTONY
11
12Need coorsponding number to fill in below
13BILL1
14BOB1
15BRIAN2
16BRYAN3
17DAVE1
18DOUG3
19ED4
20GEORGE3
21GREG1
22MIKE3
23RICK4
24STEVE2
25STU4
26TIM2
27TOM2
28TONY4
29
Sheet1
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
=IFERROR(INDEX($A$3:$A$10,MATCH(C13,$B$3:$B$10,0)),INDEX($A$3:$A$10,MATCH(C13,$C$3:$C$10,0)))

probably be able to use some of the 365 functions

Book2
ABCD
1
2User enters names here
31DAVEBILL
41BOBGREG
52TOMTIM
62STEVEBRIAN
73GEORGEBRYAN
83MIKEDOUG
94STUED
104RICKTONY
11
12Need coorsponding number to fill in below
13BILL1
14BOB1
15BRIAN2
16BRYAN3
17DAVE1
18DOUG3
19ED4
20GEORGE3
21GREG1
22MIKE3
23RICK4
24STEVE2
25STU4
26TIM2
27TOM2
28TONY4
Sheet1
Cell Formulas
RangeFormula
D13:D28D13=IFERROR(INDEX($A$3:$A$10,MATCH(C13,$B$3:$B$10,0)),INDEX($A$3:$A$10,MATCH(C13,$C$3:$C$10,0)))
 
Upvote 0
Are your names in C13 and down written manually? seems that yes. then in D13 and copy down try:
Excel Formula:
=XLOOKUP(C13,B$3:B$12,A$3:A$12,XLOOKUP(C13,C$3:C$12,A$3:A$12,"no such value",0),0)

Edit: somehow I did'nt see solution by Wayne.
It is basically the same, but using new functions.
To be exactly equivalent (no special treatment for non-existing names) will be shorter:
Excel Formula:
=XLOOKUP(C13,B$3:B$12,A$3:A$12,XLOOKUP(C13,C$3:C$12,A$3:A$12,,0),0)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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