+ Reply to Thread
Results 1 to 12 of 12

Nested "IF" and "AND" and "OR" Formula assistance

  1. #1
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Nested "IF" and "AND" and "OR" Formula assistance

    Hi All

    Here's a brainteaser I can't wrap my tiny little head around.

    Scenario is as follows:

    If C1 = "Round" or "Square" or "Tube" and N14 value is between 1 and 3
    then C2 = 3
    If C1 = "Round" or "Square" or "Tube" and N14 value is between 3 and 6
    then C2 = 6
    If C1 = "Round" or "Square" or "Tube" and N14 value is between 6 and 9
    then C2 = 9
    If C1 = "Round" or "Square" or "Tube" and N14 value is between 9 and 12
    then C2 = 12

    Thanks in advance for assistance

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Nested "IF" and "AND" and "OR" Formula assistance

    Will N14 ALWAYS contain an integer from 1 to 12?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Valued Forum Contributor mahju's Avatar
    Join Date
    11-27-2010
    Location
    Pakistan, Faisalabad
    MS-Off Ver
    Excel 2010 plus
    Posts
    730

    Re: Nested "IF" and "AND" and "OR" Formula assistance

    it is not clear that 3 is included in first condition or in second and similarly 6,9.

    Any way try this. change ">" with ">=" or "<" with "<=" if needed.

    Please Login or Register  to view this content.
    Regards
    Mark the thread as solved if you are satisfied with the answer.


    In your first post under the thread tools.

    Mahju

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Nested "IF" and "AND" and "OR" Formula assistance

    Hi Mahju

    Thank you for your response....So true.
    Will be 4, 7, 10

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Nested "IF" and "AND" and "OR" Formula assistance

    Hi Mahju

    This is my formula with exact values.
    N14 values is from 1 to 3, from 3.1 to 6, from 6.1 to 9 ...lets leave 9.1 to 12 out
    This formula returns a value of "False"

    ?????? I am lost

    =IF(C53="",0,IF(OR(C53="L BRACKETS",C53="EXTENDERS"),CEILING($N14*2,1),IF(AND(OR(C53="FULL ROUND BRACKET SGL",C53="FULL ROUND BRACKET DBL",C53="FULL ROUND BRACKET TPL"),AND(N14>1,N14<3)),3,IF(AND(OR(C53="FULL ROUND BRACKET SGL",C53="FULL ROUND BRACKET DBL",C53="FULL ROUND BRACKET TPL"),AND(N14>3.1,N14<6)),6,IF(AND(OR(C53="FULL ROUND BRACKET SGL",C53="FULL ROUND BRACKET DBL",C53="FULL ROUND BRACKET TPL"),AND(N14>=6.1,N14<=9)),9)))))

  6. #6
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Nested "IF" and "AND" and "OR" Formula assistance

    Hi Mahju

    I notice that the formula works perfectly as long as my values are full and half integers i.e 3.5 works but not 3.1

    Any ideas

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft? Excel? for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,005

    Re: Nested "IF" and "AND" and "OR" Formula assistance

    =if(c53="",0,if(or(c53="l brackets",c53="extenders"),ceiling($n14*2,1),if(and(or(c53="full round bracket sgl",c53="full round bracket dbl",c53="full round bracket tpl"),n14>=1,n14<=9),int(((n14-1)/3)+1)*3)))

  8. #8
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Nested "IF" and "AND" and "OR" Formula assistance

    Hi John

    Thank you, works well if I use whole numbers, however if I use decimals, it does not provide correct answer.
    My apologies John, This is actually what I am trying to achieve:

    1 to 3 = 3
    3.1 to 6.0 = 6
    6.1 to 9.00 = 9
    9.1 to 12.00 = 12

    And not as previously mentioned

    1 to 3 = 3
    4 to 6 = 6
    7 to 9 = 9
    10 to 12 = 12

    Any way your Perfect formula can be altered for criteria
    Last edited by sintek; 01-05-2016 at 03:03 PM.

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Nested "IF" and "AND" and "OR" Formula assistance

    Hi John...Pure genius you are......

    All I had to do is subtract 0.1 from N14 and not 1

    Formula works perfectly.... thank you

  10. #10
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Nested "IF" and "AND" and "OR" Formula assistance

    Hi
    Try these
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  11. #11
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Nested "IF" and "AND" and "OR" Formula assistance

    Hi Guys

    Formula solved as follows:

    =if(c53="",0,if(or(c53="l brackets",c53="extenders"),ceiling($n14*2,1),if(and(or(c53="full round bracket sgl",c53="full round bracket dbl",c53="full round bracket tpl"),n14>=1,n14<=9),int(((n14-0.1)/3)+1)*3)))

    Awesome

  12. #12
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,122

    Re: Nested "IF" and "AND" and "OR" Formula assistance

    Hi Jose

    Would have worked perfectly. Thanks for input

+ 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: 1
    Last Post: 08-15-2014, 06:00 AM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  5. Replies: 5
    Last Post: 06-26-2006, 09:23 PM
  6. Replies: 7
    Last Post: 05-13-2006, 05:02 PM
  7. [SOLVED] If changed array formula reduce ""\""\""\ - signs to #Missing, will it make ...
    By Maria J-son in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-05-2006, 08:25 AM

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