+ Reply to Thread
Results 1 to 8 of 8

If-Then-Else

  1. #1
    Registered User
    Join Date
    11-12-2015
    Location
    Chelsea, Mass
    MS-Off Ver
    Excel 2013
    Posts
    36

    If-Then-Else

    Hello. I have this (IF-THEN-ELSE) scheme that I can’t quite get right.

    If TopTeamTotalActPts >= BottomTeamTotalActPts AND
    If TopTeamAwayActPts >= BottomTeamHomeActPts Then
    MsgBox “gotta take top team”

    If BottomTeamTotalActPts >= TopTeamTotalActPts AND
    If BottomTeamHomeActPts >= TopTeamAwayActPts Then
    MsgBox “gotta take bottom team”

    If neither of those conditions exist Then
    MsgBox “pass on this game”

    I’ve tried to figure this out using various combinations of (IF-THEN-ELSE), but I just don’t have an understanding of the code.
    If anyone has a solution and wanted to share, it would be greatly appreciated.
    Thank you.

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: If-Then-Else

    Maybe:
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

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

    Re: If-Then-Else

    I am assuming that the above is an explanation and not actual code...hence no code tags were placed
    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Forum Contributor
    Join Date
    12-02-2010
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2013, 2016
    Posts
    100

    Re: If-Then-Else

    If this is going to be a table or something with a lot of entries there is also some potential of doing this in-cell and using conditional formatting to flag the games of interest.

    Either way, if using VBA, other people were obviously faster than me. The main issue with your original post is that you don't need the second if, just input one argument, then "and" then the next argument all before the "Then".
    Mark as "Solved" and add Reputation if applicable.

  5. #5
    Registered User
    Join Date
    11-12-2015
    Location
    Chelsea, Mass
    MS-Off Ver
    Excel 2013
    Posts
    36

    Re: If-Then-Else

    Thanks very much (Mumps, sintek and DarkF1ame)

    The code worked great and helped me a lot.

    I can't seem to locate the "SOLVED" button.

  6. #6
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: If-Then-Else

    Glad to help.
    New Method
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    Old Method
    - Go to the first post
    - Click edit
    - Click Advance
    - Just below the word "Title:" you will see a dropdown with the word No prefix.
    - Change to Solve
    - Click Save

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

    Re: If-Then-Else

    Pleasure...

  8. #8
    Forum Contributor
    Join Date
    12-02-2010
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2013, 2016
    Posts
    100

    Re: If-Then-Else

    You're most welcome. Heavy lifting done by others

+ 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