+ Reply to Thread
Results 1 to 8 of 8

Simple "OR" statements in excel ?

  1. #1
    Registered User
    Join Date
    11-19-2013
    Location
    Portsmouth England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Simple "OR" statements in excel ?

    Hi

    I know this is a very newbie question - but I cant work out how to do the following would much appreciate it if someone could help please

    I have the following to print in a column if a number entered is "odd" or "even"

    =IF(OR(A12={1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35}),"odd","even")

    I cannot for the life of me work out how to modify this to give three or more results - for instance "odd" "even" "zero" "null" (I am guessing that once I have the formula for three possible results then it would be easy to understand and edit for 4 or more options).

    Cant see this question in the forums already - and apologies for what I am sure is a simple question to you guys, but I would be grateful if someone could possibly answer it please.

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Simple "OR" statements in excel ?

    =if(case1=true,1,if(case2=true,2,3))

    ?

  3. #3
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Simple "OR" statements in excel ?

    =IF(CASE1=TRUE,1,IF(CASE2=TRUE,2,3))

    ?

    So for your example:

    =IF(OR(A12={1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35}),"odd",IF(OR(A12={2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36}),"even","null"))

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

    Re: Simple "OR" statements in excel ?

    =if(iseven(a12),"even","od")

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

    Re: Simple "OR" statements in excel ?

    =if(iseven(a12),"even","odd")

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Simple "OR" statements in excel ?

    Try this:

    =IF(ISERROR(A12),"Error",IF(A12="","Null",IF(A12=0,"Zero",IF(ISNUMBER(A12+0),IF(MOD(A12,2)=0,"Even","Odd"),"Text"))))

    This should cover all possibilities.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    11-19-2013
    Location
    Portsmouth England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Simple "OR" statements in excel ?

    Thank you very much indeed - yes that did it

    Quote Originally Posted by yudlugar View Post
    =IF(CASE1=TRUE,1,IF(CASE2=TRUE,2,3))

    ?

    So for your example:

    =IF(OR(A12={1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35}),"odd",IF(OR(A12={2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36}),"even","null"))

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,411

    Re: Simple "OR" statements in excel ?

    Thanks for the Rep, styxxuk - please mark the thread as Solved if you consider it to be so (click on Thread Tools above your first post).

    Pete

+ 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. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. [SOLVED] Excel 2007: How to Convert "5/2/2013" to "May" then subtract a Month so it's "Apr"
    By Golom in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-19-2013, 02:00 AM
  3. Replies: 1
    Last Post: 09-21-2013, 03:18 AM
  4. Help with basic Excel formula for two if statements (with a "then")?
    By Hedy in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-26-2013, 03:24 PM
  5. [SOLVED] Excel should have a quick and simple "change case" function like .
    By NinaSvendsen in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-28-2005, 02:06 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