purevtsagaan
New Member
- Joined
- Mar 2, 2014
- Messages
- 4
A | B | C | |
1 | clothes | transportation | drinks |
2 | pants | car | coffee |
3 | shirt | train | tea |
4 | sweater | bicycle | juice |
5 | tie | plane | milk |
<tbody>
</tbody>
Hello everyone,
I have been trying so had to make this work.
I want to return "category 1" if the text is found in column A, "category 2"if it is found n column b, "category 3" If it is found in column c, if not found in any column "category 4".
Please help here is sheet and formula, thanks
=IF(SUBSTITUTE(A1, "-", "")=VLOOKUP(SUBSTITUTE(A1,"-",""),sheet1!$A$2:$A$6,1,FALSE),
"CATEGORY 1",
IF(SUBSTITUTE(A1, "-", "")=VLOOKUP(SUBSTITUTE(A1, "-", ""),sheet1!$B$2:$B$6,2,FALSE),
"CATEGORY 2",
IF(SUBSTITUTE(A1, "-", "")=VLOOKUP(SUBSTITUTE(A1, "-", ""),sheet1!$C$2:$C$6,3,FALSE),
"CATEGORY 3",
"Category 4")
)
)
PS: first if statement works but 2nd and 3rd ones do not. Please help me by fixing. Thanks!