I want to find a formula to check if the value of a cell in a column is in the range of a cell in another column and then add a value comprised of another column on the same line of the matching cell you are looking for in the range, and then to be able to duplicate this formula to all the cells in the column you are testing.
An example:
In this pic, I want to test if the values in column B match values from column A, when it does I want the formula to check the value on the same line of column A but on column E and add it to C column on the same line as column B I am testing.
Then I want to be able to duplicate this formula on all column C.
I have this formula that I use in column C starting from C2:
=IF(COUNTIF(A2:A5,B2),E2,0)
But it does not work well and if I try to duplicate if the range changes to A3:A6, etc.