=IF($E3="Y",IF($B3=(SEARCH($O$2,LEFT(B:B,5))),$A3,""),"")


I want to include a search function for the first 5 digits in column B and include it in an IF statement. I am not doing it right as I get a VALUE error.


Column B3 has a list of codes. I have a code in O2 (e.g.12345) and I want to only use the first 5 digits of numbers in column B (may have 123456789) and test it against o2. If there is a match in the first 5 digits of B3 to o2 then put A3 in the cell else blank etc.



Thanks.