+ Reply to Thread
Results 1 to 13 of 13

IF statement with 3 logical tests

  1. #1
    Registered User
    Join Date
    12-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    42

    IF statement with 3 logical tests

    Hi everyone,

    I have a really complicated logical test that i'm not sure how to set up...

    I have 6 rows of numbers to analyze and 3 columns (3 columns of numbers in total). In this function i want to see if 3 conditions exist

    1) I want to see if the number in column A is less than 1

    2) I want to see if the numbers follow this sequence, B5<B6,B4<B5,B3<B4,B2<B2, B1>B2

    3) B6 is less than C1 by .10 and B2 id less than C6 by .30

    All of this in one function to spit out True or False

    I know this is really busy and complicated but if anyone can help me into an IF statement I will really appreciate this!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: IF statement with 3 logical tests

    this is a shot in the dark if it doesnt work, maybe consider uploading a sample workbook with some data and exlected outcome...

    =and(A1<1,B5<B6,B4<B5,B3<B4,B2<B2, B1>B3,B6=C1*.9,B2=C6*.7)
    Last edited by FDibbins; 03-09-2013 at 12:57 AM. Reason: changed B2 to B3
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    09-27-2012
    Location
    Florida
    MS-Off Ver
    Excel XP to 2013
    Posts
    342

    Re: IF statement with 3 logical tests

    can you upload a file as an example with number to show what you need here, seems simple but it would be better to see it with the numbers.
    Last edited by Tank997; 03-09-2013 at 12:55 AM.
    Tom S.
    ↙ If you find my reply helpful click on the * down there on the left. Yeah that's it, right there, down on the left
    If your question is resolved, mark it SOLVED using the thread tools.

  4. #4
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: IF statement with 3 logical tests

    Quote Originally Posted by wallstreetballa
    B5<B6,B4<B5,B3<B4,B2<B2, B1>B2
    See the red one, it's true like that?
    Click (*) if you received helpful response.

    Regards,
    David

  5. #5
    Registered User
    Join Date
    12-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: IF statement with 3 logical tests

    Quote Originally Posted by SDCh View Post
    See the red one, it's true like that?
    hey sorry tghat was a typo

    should be B2<B3

  6. #6
    Registered User
    Join Date
    12-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: IF statement with 3 logical tests

    Quote Originally Posted by FDibbins View Post
    this is a shot in the dark if it doesnt work, maybe consider uploading a sample workbook with some data and exlected outcome...

    =and(A1<1,B5<B6,B4<B5,B3<B4,B2<B2, B1>B3,B6=C1*.9,B2=C6*.7)
    Thanks a boatload for this, I really appreciate it!

    It works but i'm not sure if its right or not... it gave 250 false's for the rule

    i'm essentially trying to test 3 conditions in one test, i'm wondering if it might be easier to do it individually any add and compare the differences from there...

    Any suggestions?

  7. #7
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: IF statement with 3 logical tests

    IF all column A < 1 change FDibbins formula like this:
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    12-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: IF statement with 3 logical tests

    Quote Originally Posted by SDCh View Post
    IF all column A < 1 change FDibbins formula like this:
    Please Login or Register  to view this content.
    This formula looks a lot more ordered. I tried it, it works but once again everythings false...

    I need to try a couple variations with it

    Thanks a million!!

  9. #9
    Registered User
    Join Date
    12-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: IF statement with 3 logical tests

    just wondering...

    whats the format for 3 logical tests...? I've been looking for a guide or some instruction on this

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: IF statement with 3 logical tests

    try something like...

    =if(A1=B1,"XXX",if(A1=C1,"YYY","ZZZ"))

    If you go more than that, I would suggest using a vlookup or index/match

  11. #11
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: IF statement with 3 logical tests

    Can you upload example file, so anyone in here can give a better suggestions?

  12. #12
    Registered User
    Join Date
    12-22-2012
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    42

    Re: IF statement with 3 logical tests

    Quote Originally Posted by SDCh View Post
    Can you upload example file, so anyone in here can give a better suggestions?
    I'd love to SDch but its private information,

    I'll try to upload something similar

    I appreciate all of the help!

  13. #13
    Forum Contributor
    Join Date
    09-27-2012
    Location
    Florida
    MS-Off Ver
    Excel XP to 2013
    Posts
    342

    Re: IF statement with 3 logical tests

    wallstreetballa , we don't need to see your actual data just some made up numbers and column labels that demonstrates you're question.

+ 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