+ Reply to Thread
Results 1 to 5 of 5

Strugling IF Formula

  1. #1
    Registered User
    Join Date
    07-13-2005
    Posts
    64

    Strugling IF Formula

    HI All,

    I am trying to write an OR IF formula. Maybe there is an easier way.

    This is what I am trying to write =IF(a2=D1,1,0),orif(B2=D1,2,0),orif(C2=D1,1,0) - The formula would be in D2

    What the formula needs to say is if the value in A2 equals D1 return value 1, or if not then if the value in B2 equals D1 return value 2, or if not then if the value in C2 equals D1 return value 1.

    Please help maybe I am trying the wrong formular?

    thanks
    Brento

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Try this

    =IF(B2=D1,2,IF(OR(A2=D1,C2=D1)<>"",1,""))

  3. #3
    macropod
    Guest

    Re: Strugling IF Formula

    Hi Brento,

    Try:
    =IF(A2=D1,1,IF(B2=D1,2,IF(C2=D1,1,0)))

    --
    macropod
    [MVP - Microsoft Word]


    "Brento" <[email protected]> wrote in
    message news:[email protected]...
    >
    > HI All,
    >
    > I am trying to write an OR IF formula. Maybe there is an easier way.
    >
    > This is what I am trying to write
    > =IF(a2=D1,1,0),orif(B2=D1,2,0),orif(C2=D1,1,0) - The formula would be
    > in D2
    >
    > What the formula needs to say is if the value in A2 equals D1 return
    > value 1, or if not then if the value in B2 equals D1 return value 2, or
    > if not then if the value in C2 equals D1 return value 1.
    >
    > Please help maybe I am trying the wrong formular?
    >
    > thanks
    > Brento
    >
    >
    > --
    > Brento
    > ------------------------------------------------------------------------
    > Brento's Profile:

    http://www.excelforum.com/member.php...o&userid=25213
    > View this thread: http://www.excelforum.com/showthread...hreadid=561717
    >




  4. #4
    Michel Bru
    Guest

    Re: Strugling IF Formula


    VBA Noob a =E9crit :

    > Try this
    >
    > =3DIF(B2=3DD1,2,IF(OR(A2=3DD1,C2=3DD1)<>"",1,""))


    Sorry, this is wrong.

    This is not what Brento has asked for!
    macropod give the right solution.

    Michel Bruy=E8re.


  5. #5
    Michel Bru
    Guest

    Re: Strugling IF Formula


    VBA Noob a =E9crit :

    > Try this
    >
    > =3DIF(B2=3DD1,2,IF(OR(A2=3DD1,C2=3DD1)<>"",1,""))


    Sorry, this is wrong.

    This is not what Brento has asked for!
    macropod give the right solution.

    Michel Bruy=E8re.


+ 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