+ Reply to Thread
Results 1 to 5 of 5

IF function, i think??? please help.

  1. #1
    nmc1104
    Guest

    IF function, i think??? please help.

    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

  2. #2
    Bernard Liengme
    Guest

    Re: IF function, i think??? please help.

    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
    --
    Bernard V Liengme
    www.stfx.ca/people/bliengme
    remove caps from email


    "nmc1104" <[email protected]> wrote in message
    news:[email protected]...
    >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




  3. #3
    Elkar
    Guest

    RE: IF function, i think??? please help.

    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

    "nmc1104" wrote:

    > 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


  4. #4
    nmc1104
    Guest

    RE: IF function, i think??? please help.

    Thanks Bernard and Elkar....You are MASTERS OF EXCEL!!!

    "Elkar" wrote:

    > 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
    >
    > "nmc1104" wrote:
    >
    > > 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


  5. #5
    Bernard Liengme
    Guest

    Re: IF function, i think??? please help.

    But I prefer
    =4-(OR(A1="P",A1="PH"))-2*OR(B1="P",P1="PH")
    --
    Bernard V Liengme
    www.stfx.ca/people/bliengme
    remove caps from email

    "nmc1104" <[email protected]> wrote in message
    news:[email protected]...
    >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




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1