Data from sheet2 name 1 column and ID second column used on sheet 1

im not sure if possible but i have a sheet to that has names on it with ids im wondering if there a way to get that data from sheet2 over to sheet 1 but only taking the name and id. basically im trying to get certain cells to auto fill with data from sheet 2. example i have name: jane smith and user ID: is blank on sheet 1 and on sheet 2 i have a list of names and smith, jane is in row A10 and her id is in B10 what i want to be able to do is when name is typed ID fills in with users ID from B10 and vice versa if user ID is given i would like the name to auto fill with name say Janes ID was 123456 so we put that in the name should auto fill with Smith, Jane. any ideas?

i came up with this it is working but it keeps taking data from the row above the one its matching. and if it doesnt find exact name it gives you closest to it and i want it to come up NA if it findings nothing.
=VLOOKUP(A22,$Sheet2.$A$1:$D$8631,4,1) it seems to be working just getting wrong row to come through. any ideas?

Look carefully at the fourth parameter. Not 1, but 0

Is the data you are looking up sorted in col A? If not, change your formula to have the value zero for the last argument.

=VLOOKUP(A22,$Sheet2.$A$1:$D$8631,4,0) 

Check the Help entry for VLOOKUP for more information.

If this answer helped you, please accept it by clicking the check mark :heavy_check_mark: to the left and, karma permitting, upvote it. If this resolves your problem, close the question, that will help other people with the same question.