we can use two-way XLOOKUP for searching any specific value in the table.

=XLOOKUP(B2,B5:D5,XLOOKUP(B1,A6:A14,B6:D14))----->>>>answer is 22
=XLOOKUP(B1,A6:A14,XLOOKUP(B2,B5:D5,B6:D14))----->>>>answer is 22
By this formula and by changing the name or any characteristic, the desired output can be achieved. for example:

=XLOOKUP(B2,B5:D5,XLOOKUP(B1,A6:A14,B6:D14))----->>>>answer is 235
XLOOKUP function
XLOOKUP function searches a range or an array for a match and returns the corresponding item from a second range or array.
XLOOKUP arguments
XLOOKUP(Lookup value,Table_array,Return_array,If_not_found,Match_mode)
This function has just 5 Arguments:
- Lookup value is the value to search for.
- Table_array is the array or range to search.
- Return_array is the array or range to return.
- If_not_found is returned if no match is found.
- Match_mode specifies how to match lookup_value against the values in lookup_array.
Match_mode and If_not_found arguments of XLOOKUP function are optional.