+ Reply to Thread
Results 1 to 5 of 5

IF OR different answers

  1. #1
    Registered User
    Join Date
    11-20-2013
    Location
    Northamptonshire
    MS-Off Ver
    Excel 2010
    Posts
    22

    IF OR different answers

    Hi,

    I thought the formula below would give me the result of:

    7 if I5=1
    6 if I5=2
    5 if I5=3 and so on but it doesnt seem to work. Can anyone help with where I am going wrong?

    =IF(OR(I5={1,2,3,4}),{7,6,5,4})

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: IF OR different answers

    Maybe:

    =IF(OR(I5={1,2,3,4}),CHOOSE(I5,7,6,5,4),"")
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: IF OR different answers

    OR only returns a true or false value.
    So if I5 is say 3, then it's
    =IF(OR(I5={1,2,3,4}),{7,6,5,4})
    =IF(TRUE,{7,6,5,4})

    At this point, IF doesn't know what to do with the array of values, so it just picks the first value in the array.

    Try this instead

    =INDEX({7,6,5,4},MATCH(I5,{1,2,3,4},0))

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: IF OR different answers

    =8-I5 would do it
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Valued Forum Contributor
    Join Date
    10-29-2012
    Location
    Mojokerto,Indonesia
    MS-Off Ver
    Excel 2007
    Posts
    554

    Re: IF OR different answers

    try this one without or
    =IF(I5=1,7,IF(I5=2,6,3))

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. No problem, just always looking for answers.
    By jimalya in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 05-26-2013, 12:38 AM
  2. [SOLVED] Matching with two different answers
    By mack zilla in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-01-2013, 11:34 AM
  3. [SOLVED] Count the number of matches in a row of one word answers with a row of correct answers
    By flammer4 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-03-2012, 01:17 PM
  4. Answers YES and NO
    By Michelle66 in forum Excel General
    Replies: 3
    Last Post: 12-17-2011, 10:00 PM
  5. [SOLVED] 3 Questions - No Answers - Help me please
    By Adam Harding in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2005, 02:05 PM

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