+ Reply to Thread
Results 1 to 8 of 8

How to return a value instead of TRUE/FALSE with IF,OR,AND statement

  1. #1
    Registered User
    Join Date
    03-14-2014
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2013
    Posts
    4

    How to return a value instead of TRUE/FALSE with IF,OR,AND statement

    I am working on a nest of conditional IF statements containing OR & AND conditions and keep getting TRUE/FALSE instead of getting a value. Any ideas looking at my formula why I wouldn't be getting a value? If I run just one of the IF statements, I get a value, but when I start adding two or more, only TRUE/FALSE. Ideas?

    =OR(IF(AND(B7=1,C7=1,D7>=1),1,IF(AND(B7=2,C7=1,D7=1),2,IF(AND(B7=3,C7=1,D7=1),4,IF(AND(B7=2,C7=1,D7=2),3,IF(AND(B7=3,C7>=2,D7>=1),5,IF(AND(B7=3,C7=1,D7>=2),5)))))))

  2. #2
    Registered User
    Join Date
    02-13-2013
    Location
    Rogers
    MS-Off Ver
    Excel 2007
    Posts
    46

    Re: How to return a value instead of TRUE/FALSE with IF,OR,AND statement

    Can you attach an example spreadsheet? That would help identify the issue. Thanks!

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: How to return a value instead of TRUE/FALSE with IF,OR,AND statement

    All your IFs are in an OR, OR will always return TRUE/FALSE.
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    03-14-2014
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: How to return a value instead of TRUE/FALSE with IF,OR,AND statement

    Is there another way to get the conditional value with multiple variables? Thanks

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

    Re: How to return a value instead of TRUE/FALSE with IF,OR,AND statement

    Just remove the OR.

    =IF(AND(B7=1,C7=1,D7>=1),1,IF(AND(B7=2,C7=1,D7=1),2,IF(AND(B7=3,C7=1,D7=1),4,IF(AND(B7=2,C7=1,D7=2),3,IF(AND(B7=3,C7>=2,D7>=1),5,IF(AND(B7=3,C7=1,D7>=2),5))))))

  6. #6
    Registered User
    Join Date
    03-14-2014
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: How to return a value instead of TRUE/FALSE with IF,OR,AND statement

    What I am trying to achieve is this...

    For three variable (F,P,D) there can be a value from 1-3 So for example F=2, P=2, D=1

    Then I am taking those three data points and locating them on another chart that looks like

    P
    1 2 3
    D 1 2 3 1 2 3 1 2 3
    F 1 1 1 1 2 2 3 2 4 5
    2 2 3 4 3 3 4 3 4 5
    3 4 5 5 5 5 5 5 5 5

    (Sorry I couldn't get a chart into this, but the P values are spread out over the D values where as P1 would cover D1,2,3, etc.)

    So from the example above, the number would be 2

    The subsequent value from this chart is then placed in a third and separate chart which is where my formula will be nested.

  7. #7
    Registered User
    Join Date
    03-14-2014
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2013
    Posts
    4

    Re: How to return a value instead of TRUE/FALSE with IF,OR,AND statement

    Ok... I feel officially dumb now... Thanks Jonmo1! Excel has a way of doing that very easily though

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

    Re: How to return a value instead of TRUE/FALSE with IF,OR,AND statement

    You're welcome.

+ 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. Replies: 9
    Last Post: 01-21-2013, 01:54 AM
  2. [SOLVED] I need an IF statement that has more than True and False
    By Legend Rubber in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-18-2012, 07:00 AM
  3. If statement with a range and true/false statement
    By aarleblanc in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-20-2012, 06:34 PM
  4. [SOLVED] Search for 2 true arguments and return true or false
    By David in forum Excel General
    Replies: 3
    Last Post: 07-15-2006, 05:20 AM
  5. Function to return True/False if all are validated as True by ISNU
    By Tetsuya Oguma in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-15-2006, 06:30 AM

Tags for this Thread

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