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

时间:2015-06-30 13:41:26

标签: excel function

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:

  • if Col A contains UNLPKG then it will select data from Col B
  • if Col A contains IR then it will select data from Col C.

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.

2 个答案:

答案 0 :(得分:1)

If your data starts at row 2

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

答案 1 :(得分:0)

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

相关问题