Setting values in column based on characters combination...

orit

New Member
Joined
Oct 31, 2004
Messages
44
I have the following table:

Part Number | Pass\Fail\Ignore
_____________________
NMS123 | P, F
NMS221 | P, P, P
NMS678 | I, P, F
NMS666 | F, F, I, F
NMS890 | F, F, P

I want in a 3rd column to get value according the characters contained in the 2nd column ("Pass\Fail\Ignore):
If all the characters in the 2nd col are "P", the value in the 3rd column will be: "Fully Passed".
If at least one of the characters in the 2nd col is "P" and there is other characters in addition to "P", the value in the 3rd column will be: "Partially Passed".
If the 2nd col contains other characters ("F" and\or "I") and not "P" at all - the value in the 3rd column will be "Failed".

So, the example table will look like:
Part Number | Pass\Fail\Ignore | Test Result
_____________________
NMS123 | P, F | Partially Passed
NMS221 | P, P, P | Fully Passed
NMS678 | I, P, F | Partially Passed
NMS666 | F, F, I, F | Failed
NMS890 | F, F, P | Partially Passed

How to do that?

Thanks a lot
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
How about?

=IF(ISNUMBER(SEARCH("F",B2)),IF(ISNUMBER(SEARCH("P",B2)),"Partially passed","Failed"),"Fully passed")
 
Upvote 0
Assuming that the string to test is in A1 try:

Code:
=IF(ISERROR(FIND("P",A1,1)),"Failed",IF(ISERROR(FIND("P",A1,FIND("P",A1,FIND("P",A1,1)+1)+1)),"Partially Passed","Fully Passed"))
 
Upvote 0
=IF(ISNUMBER(SEARCH("F",B2)),IF(ISNUMBER(SEARCH("P",B2)),"Partially passed","Failed"),"Fully passed")

Thanks a lot, that's the exact direction.

just - I'm trying unsuccessfully to complete it, so the character "I" will act like "F": If "F" or "I" exist in the cell - the result is partially passed or failed, can you please assist?

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,449
Members
448,966
Latest member
DannyC96

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top