+ Reply to Thread
Results 1 to 10 of 10

If Statement return “W” or “L” result

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    07-16-2008
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    106

    If Statement return “W” or “L” result

    Hello can someone help me on creating a formula that will give me a result of either "W" or "L" depending on the amount in corresponding cell.

    Example has been attached

    Thanks
    Attached Files Attached Files
    Last edited by Killer17; 10-14-2008 at 08:02 PM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    Hi Killer,

    I'm assuming you're trying to compare cells D5 to D8, E5 to E8, etc., and the highest number gets the "W"?

    If so, in D6 use:

    =IF(D5>D8,"W","L")

    Then in D9 use:
    =IF(D6="W","L","W")

    In D9 you could use =IF(D8>D5,"W","L"), but you don't necessarily need to since you've already determined the W or L value in D6. Whatever is in D6, you want the opposite in D9.

    If this isn't the case let us know.

  3. #3
    Registered User
    Join Date
    10-13-2008
    Location
    Australia
    Posts
    5
    What's the condition for when it needs to return W or L?

    Your basic formula should be =if(condition,if true,if false), for an example lets assume you are looking at a numerical value in Cell A1, and if it is equal to or less than 10 you want it to return W, but if it's greater than 10 you want it to return L.

    =if(A1<=10,"W","L")

    Simply change your cell reference and condition to match your needs.

  4. #4
    Forum Contributor
    Join Date
    07-16-2008
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    106
    Hey Paul

    Thanks for the help this formula works

    =IF(D8>D5,"W","L")

    But it’s added L if cell is empty is there a way of not showing anything until there's an actual number in the 2 cells?

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    =if(or(d8 = "", d5 = ""), "", if(d8 > d5, "w", "l") )
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Contributor snasui's Avatar
    Join Date
    07-15-2007
    Location
    Songkhla, Thailand
    MS-Off Ver
    2010, 365
    Posts
    167
    Try this,

    =If(And(D5<>"",D8<>""),If(D5>D8,"W","L"),"")

  7. #7
    Forum Contributor
    Join Date
    07-16-2008
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    106
    Hey snasui

    It's not working I think it might becasue I have this formula in Cell D5

    =IF(OR(D12=0,D13=0),0,D12+D13)
    Last edited by Killer17; 10-14-2008 at 07:46 PM.

  8. #8
    Forum Contributor snasui's Avatar
    Join Date
    07-15-2007
    Location
    Songkhla, Thailand
    MS-Off Ver
    2010, 365
    Posts
    167
    Replace... And(D5<>""... with ... And(D5<>0...

    Succeed?

  9. #9
    Forum Contributor
    Join Date
    07-16-2008
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    106
    Thanks snasui it did the job


  10. #10
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Quote Originally Posted by Killer17 View Post
    Thanks snasui it did the job

    I would have hoped you learned by now... almost every post I answered of yours, as well as from several other members have answered you in the same way: I.e. change the "" to a 0. This is because you have formulas in the reference cells that do not really return blanks... If you go to Tools|Options and select "Zero Values" from the View tab, you will see that you have 0's in those cells not blanks.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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. Spellnumber
    By Williams in forum Excel - New Users/Basics
    Replies: 13
    Last Post: 02-16-2020, 03:34 AM
  2. number to words
    By vjn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-05-2008, 04:57 AM
  3. Numbers to Text
    By sachinattri in forum Excel General
    Replies: 6
    Last Post: 06-15-2008, 03:07 AM
  4. Vlookup: Return result above or below
    By surferpatton in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-25-2008, 09:42 AM
  5. Spell number
    By nowfal in forum Excel General
    Replies: 4
    Last Post: 08-20-2007, 04:21 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