IF function, i think??? please help.

N

nmc1104

I think i need to use the IF function here, but i'm not sure. Here's what
I'm trying to do.

If cell A1 and B1 ARE coded with "P" or "PD" assign a value of "1" in C1.
If cell A1 IS NOT coded with "P" or "PD" and B1 IS coded with "P" or "PD"
assign a value of "2" in C1.
If cell A1 IS coded with "P" or "PD" and B1 IS NOT coded with "P" or "PD"
assign a value of "3" in C1.
If cell A1 and B1 ARE NOT coded with "P" or "PD" assign a value of "4" in C1.

I hope someone can help. Example spreadsheet is below:

Column A Column B Column C
P PD
L P
PD M
T T
 
B

Bernard Liengme

Try
=IF(OR(A1="P",A1="PD"),IF(OR(B1="P",B1="PD" ),1,3),IF(OR(B1="P",B1="PD" ),2,4))
best wishes
 
E

Elkar

Try this:

=IF(AND(OR(A1={"PD","P"}),OR(B1={"PD","P"})),1,IF(AND(AND(A1<>{"PD","P"}),OR(B1={"PD","P"})),2,IF(AND(OR(A1={"PD","P"}),AND(B1<>{"PD","P"})),3,4)))

HTH,
Elkar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top