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

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
How about?

=IF(ISNUMBER(SEARCH("F",B2)),IF(ISNUMBER(SEARCH("P",B2)),"Partially passed","Failed"),"Fully passed")
 

lozzablake

Well-known Member
Joined
Dec 15, 2005
Messages
818
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"))
 

orit

New Member
Joined
Oct 31, 2004
Messages
44
=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
 

Forum statistics

Threads
1,136,878
Messages
5,678,320
Members
419,755
Latest member
eshnider21

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
Top