Sumeet Yadav
Sumeet Yadav

Reputation: 3

Conditionally choose data from different columns based of data in another column

I'm trying to build an Excel formula that will search a given cell for a certain character in a specific order, and then select the specific data as per that.

Eg:
Col A        Col B       Col C
---------    --------    -------
FIGUNLPKG    1/1/2015    1/15/2015   ' select from B
REUNLPKG     1/1/2015    1/15/2015   ' select from B
REIR         1/1/2015    1/15/2015   ' select from C
MCUNLPKG     1/1/2015    1/15/2015   ' select from B
REIRAWC      1/1/2015    1/15/2015   ' select from C

Now, I want that:

Also, I have two more scenario, like if the Col A contains - FIGUNLPKG, BAIR then it should select the data from Col C instead of Col B. And if the Col A contains something which don't match our criteria then it will by default select Col B data.

Upvotes: 0

Views: 69

Answers (2)

yoyoyoyo123
yoyoyoyo123

Reputation: 2472

If your data starts at row 2

=IF(IFERROR(FIND("UNLPKG",A2),0)>0,B2,IF(IFERROR(FIND("IR",A2),0)>0,C2,""))

Upvotes: 1

jlee88my
jlee88my

Reputation: 3043

Would a simple FIND() function do the trick? Unless of course, if you have a much more complex table, then you will need to build a VLookUp table. Simple FIND() function

Upvotes: 0

Related Questions