Google-sheets – How to pick up a value from a cell with the left cell value equals to something in Google Sheets

google sheets

Here is my table:

1 |  A   |  B    |   C  |
-------------------------
2 | Name | Value |   *  |
3 | Joe  | 10    |
4 | Bob  | 21    |
5 | Rick | 62    |
6 | Terry| 38    |
7 | Jim  | 77    |

I want the * cell be a value of a given name, like Jim in this case, it should be 77. Is there any formula I can use?

I have made some guess but failed. My guess:

=QUERY(A:B, "select B when A<>Jim")

Best Answer

=QUERY(A1:B; "select B where A ='"&A7&"'"; 0)