+ Reply to Thread
Results 1 to 18 of 18

If statement AND/OR/IfThen?

  1. #1
    Registered User
    Join Date
    12-10-2018
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    54

    If statement AND/OR/IfThen?

    I'm not too familiar with the AND/OR/IfThen functions or maybe a better way to go about it, but what i'm trying to do is score two categories of Customers 2S and 3S and their levels.

    2S customers must have 1 level 2 and 1 other level
    3S Must have 1 level 1 and 1 other level

    If the conditions are not met, I would like to have them score a 0.

    If the conditions are met, a 1 or 2 or even just a value other than 0 would be work.

    So just not sure how to proceed. Almost as if there is a If/Then type... matching the 2S or 3S then going through the criteria to meet.

    I've attached a sample workbook

    Any help is appreciated
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If statement AND/OR/IfThen?

    I'm not sure that I follow.

    Are the desired results included in the sample workbook? If not, I recommend including those and then re-uploading your sample.

  3. #3
    Registered User
    Join Date
    12-10-2018
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    54

    Re: If statement AND/OR/IfThen?

    desired results are something showing that the main condition is met with another, it can be anything (i'm not picky and can change it), but could be:

    Conditions met = 1
    Conditions not met = 0

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If statement AND/OR/IfThen?

    I am going against my better judgement to insist that you follow the request from post #2.

    Try this in F2:

    =--OR(AND(B2="2S",D2>0,SUM(C2,E2)>0),AND(B2="3S",C2>0,SUM(D2,E2)>0))

    Make sure that you convert the numbers in column E from Text to actual numbers.
    Last edited by 63falcondude; 01-10-2019 at 12:32 PM.

  5. #5
    Registered User
    Join Date
    12-10-2018
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    54

    Re: If statement AND/OR/IfThen?

    I've re-uploaded the worksheet.

    With the desired results.
    Attached Files Attached Files

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If statement AND/OR/IfThen?

    Thank you.

    The formula from post #4 gives the desired results shown from the workbook in post #5 (except for in cell F6) after converting the "Text" numbers in column E to actual numbers.

    To convert the numbers, you'll have to un-merge cell B10, then you can highlight column E > Text to Columns > Finish

    Can you explain why, given the criteria from post #1, F6 should be 1?

  7. #7
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: If statement AND/OR/IfThen?

    Is this right?

    F2
    =SUMPRODUCT((B2={"3S","2S"})*(C2:D2>0))*(SUMPRODUCT(--C2:E2)>1)

  8. #8
    Registered User
    Join Date
    12-10-2018
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    54

    Re: If statement AND/OR/IfThen?

    Quote Originally Posted by 63falcondude View Post
    Can you explain why, given the criteria from post #1, F6 should be 1?
    Because of 2 Level 1's. they have the minimum 1 Level 1 plus 1 other.

  9. #9
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If statement AND/OR/IfThen?

    Oh so the one "other" doesn't have to be in a different level?

    In that case, assuming that 2S and 3S are the only Types, you can use this:

    =--AND(IF(B2="2S",D2,C2)>0,SUM(C2:E2)>1)

  10. #10
    Registered User
    Join Date
    12-10-2018
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    54

    Re: If statement AND/OR/IfThen?

    Quote Originally Posted by Bo_Ry View Post
    Is this right?

    F2
    =SUMPRODUCT((B2={"3S","2S"})*(C2:D2>0))*(SUMPRODUCT(--C2:E2)>1)
    Almost, it comes up a-ok for everything except for if there is a 2S customer with a Level 1 and a Level 3
    I didn't notice those until the formula (reattached book1, Name 7,8 for examples)

    3S is all good
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    12-10-2018
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    54

    Re: If statement AND/OR/IfThen?

    it does not, can be two of the same or more...

  12. #12
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If statement AND/OR/IfThen?

    Quote Originally Posted by Cleetus09 View Post
    it does not, can be two of the same or more...
    Understood. Have you tried the formula from post #9 after converting the Text numbers to actual numbers?

  13. #13
    Registered User
    Join Date
    12-10-2018
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    54

    Re: If statement AND/OR/IfThen?

    Quote Originally Posted by 63falcondude View Post
    Understood. Have you tried the formula from post #9 after converting the Text numbers to actual numbers?
    I did but same issue with Bo, the Name 7 and Name 8 lines don't work for the 2S customer. The rare occasion they have Level 1 or upgraded a level 2 to a Level 1.

  14. #14
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If statement AND/OR/IfThen?

    Quote Originally Posted by Cleetus09 View Post
    I did but same issue with Bo, the Name 7 and Name 8 lines don't work for the 2S customer. The rare occasion they have Level 1 or upgraded a level 2 to a Level 1.
    In post #1 you said:
    2S customers must have 1 level 2 and 1 other level
    Names 7 and 8 don't have a level 2.

  15. #15
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: If statement AND/OR/IfThen?

    How about

    =((B2="3S")*(C2>0)+(B2="2S"))*(SUMPRODUCT(--C2:E2)>1)

  16. #16
    Registered User
    Join Date
    12-10-2018
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    54

    Re: If statement AND/OR/IfThen?

    Quote Originally Posted by 63falcondude View Post
    In post #1 you said:


    Names 7 and 8 don't have a level 2.
    It skipped my mind that it was possible... until the formula brought it to light. I could manually change them if needed as its just 3 out of 200.

  17. #17
    Registered User
    Join Date
    12-10-2018
    Location
    Canada
    MS-Off Ver
    Microsoft 365
    Posts
    54

    Re: If statement AND/OR/IfThen?

    Quote Originally Posted by Bo_Ry View Post
    How about

    =((B2="3S")*(C2>0)+(B2="2S"))*(SUMPRODUCT(--C2:E2)>1)
    I think that does it!

  18. #18
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: If statement AND/OR/IfThen?

    Thanks for the rep!

+ 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] Ifthen formula help
    By katiedee1625 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-29-2016, 11:06 AM
  2. ifthen problem
    By lschwinkendorf in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-17-2015, 02:40 PM
  3. IFTHEN Statement - checking if a number is larger by a certain % - noob question
    By wallstreetballa in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-06-2013, 02:22 AM
  4. Replies: 1
    Last Post: 06-29-2012, 03:27 PM
  5. [SOLVED] IFTHEN Statements and Dates
    By Rapacious in forum Excel General
    Replies: 6
    Last Post: 04-10-2012, 07:06 PM
  6. SumProduct & IFThen, and other formulas
    By DCMADiva87 in forum Excel General
    Replies: 2
    Last Post: 08-30-2010, 04:29 PM
  7. if and or ifthen?
    By Pam in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-17-2006, 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