+ Reply to Thread
Results 1 to 10 of 10

IF Function

  1. #1
    News Account
    Guest

    IF Function

    Is it possible to define a text value in an IF function to a particular
    colour, the function is

    =IF(C38=1,"Win",IF(C38=2,"Win",IF(C38=-1,"Loss",IF(C38=-2,"Loss",IF(C38=0,0)
    ))))

    I would prefer the "Loss" to entered automatically in red.

    Many thanks



  2. #2
    Mayank Prakash Gupta
    Guest

    Re: IF Function

    do conditional formatting on the cell (or column) and say that if the cell
    value is "loss" paint it red....

    goto Format>conditional formattting

    hope it helps.
    MPG

    "News Account" <[email protected]> wrote in message
    news:[email protected]...
    > Is it possible to define a text value in an IF function to a particular
    > colour, the function is
    >
    > =IF(C38=1,"Win",IF(C38=2,"Win",IF(C38=-1,"Loss",IF(C38=-2,"Loss",IF(C38=0,0)
    > ))))
    >
    > I would prefer the "Loss" to entered automatically in red.
    >
    > Many thanks
    >
    >




  3. #3
    Bob Phillips
    Guest

    Re: IF Function

    I don't think it can be done, you would need VBA to be acting on the cell.

    --
    HTH

    Bob Phillips

    "News Account" <[email protected]> wrote in message
    news:[email protected]...
    > Is it possible to define a text value in an IF function to a particular
    > colour, the function is
    >
    >

    =IF(C38=1,"Win",IF(C38=2,"Win",IF(C38=-1,"Loss",IF(C38=-2,"Loss",IF(C38=0,0)
    > ))))
    >
    > I would prefer the "Loss" to entered automatically in red.
    >
    > Many thanks
    >
    >




  4. #4
    Michael
    Guest

    RE: IF Function

    Hi
    As you only have 3 conditions, try using Conditional Formatting.
    Use cell value is equal to WIN, Cell value is equal to LOSS and cell value
    is equal to 0
    You could also consider changing your formula to:
    =IF(OR(C38=1,C38=2),"WIN",IF(OR(C38=-1,C38=-2),"LOSS",0))


    HTH
    Michael Mitchelson


    "News Account" wrote:

    > Is it possible to define a text value in an IF function to a particular
    > colour, the function is
    >
    > =IF(C38=1,"Win",IF(C38=2,"Win",IF(C38=-1,"Loss",IF(C38=-2,"Loss",IF(C38=0,0)
    > ))))
    >
    > I would prefer the "Loss" to entered automatically in red.
    >
    > Many thanks
    >
    >
    >


  5. #5
    Michael
    Guest

    RE: IF Function

    Just a little more thinking outside the box.
    If it wasn't vital that you used -2,-1,0,1,2 and changed to all positive
    numbers, ie, 1,2,3,4,5.
    You could use this formula instead.

    =CHOOSE(C38,"loss","loss",0,"win","win")

    I obviously need to get a real life !!
    Regards
    Michael Mitchelson


    "Michael" wrote:

    > Hi
    > As you only have 3 conditions, try using Conditional Formatting.
    > Use cell value is equal to WIN, Cell value is equal to LOSS and cell value
    > is equal to 0
    > You could also consider changing your formula to:
    > =IF(OR(C38=1,C38=2),"WIN",IF(OR(C38=-1,C38=-2),"LOSS",0))
    >
    >
    > HTH
    > Michael Mitchelson
    >
    >
    > "News Account" wrote:
    >
    > > Is it possible to define a text value in an IF function to a particular
    > > colour, the function is
    > >
    > > =IF(C38=1,"Win",IF(C38=2,"Win",IF(C38=-1,"Loss",IF(C38=-2,"Loss",IF(C38=0,0)
    > > ))))
    > >
    > > I would prefer the "Loss" to entered automatically in red.
    > >
    > > Many thanks
    > >
    > >
    > >


  6. #6
    Forum Contributor
    Join Date
    06-10-2005
    Location
    Central Jersey
    Posts
    117
    Is it just me, or can News Account just simply go to Format->Conditional Formatting and choose "Formula Is" and Just write:

    =C1="Loss"
    (Given C1 is to be evaluated)

    Then format the text to be red?
    It would read the cell and if it says "Loss" it would format red, if not...then nothing.

    I didn't miss anything did I?
    If not, I think this should work just fine.

    Quote Originally Posted by News Account
    Is it possible to define a text value in an IF function to a particular
    colour, the function is

    =IF(C38=1,"Win",IF(C38=2,"Win",IF(C38=-1,"Loss",IF(C38=-2,"Loss",IF(C38=0,0)
    ))))

    I would prefer the "Loss" to entered automatically in red.

    Many thanks
    -Joseph

  7. #7
    Michael
    Guest

    Re: IF Function

    Hi Malik
    Nothing wrong with your thinking.
    The OP would still need to use the formula 3 times in Conditional Formatting
    though.
    One for win, one for loss, and one for draw
    But, that's why we are all here helping each other.......'cause we think
    differently.
    Regards
    Michael Mitchelson


    "malik641" wrote:

    >
    > Is it just me, or can News Account just simply go to Format->Conditional
    > Formatting and choose "Formula Is" and Just write:
    >
    > =C1="Loss"
    > (Given C1 is to be evaluated)
    >
    > Then format the text to be red?
    > It would read the cell and if it says "Loss" it would format red, if
    > not...then nothing.
    >
    > I didn't miss anything did I?
    > If not, I think this should work just fine.
    >
    > News Account Wrote:
    > > Is it possible to define a text value in an IF function to a particular
    > > colour, the function is
    > >
    > > =IF(C38=1,"Win",IF(C38=2,"Win",IF(C38=-1,"Loss",IF(C38=-2,"Loss",IF(C38=0,0)
    > > ))))
    > >
    > > I would prefer the "Loss" to entered automatically in red.
    > >
    > > Many thanks

    >
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=390126
    >
    >


  8. #8
    Forum Contributor
    Join Date
    06-10-2005
    Location
    Central Jersey
    Posts
    117
    Well if he wants a color ONLY for loss...then what I said should be all he needs.

    Here's an attachment to show you what I mean.
    Play with C38 (i.e. put "1" or "-1" or "0") and watch cell A1
    Then select A1 and select Format->Conditional Formatting, and you'll see what I mean.

    If there's anything that I'm missing, let me know....otherwise I'm pretty sure this is what News Account originally asked for.

    Let me know

    Quote Originally Posted by Michael
    Hi Malik
    Nothing wrong with your thinking.
    The OP would still need to use the formula 3 times in Conditional Formatting
    though.
    One for win, one for loss, and one for draw
    But, that's why we are all here helping each other.......'cause we think
    differently.
    Regards
    Michael Mitchelson
    Attached Files Attached Files

  9. #9
    Michael
    Guest

    Re: IF Function

    Malik
    You are correct !!
    I think we just extended his thinking a little bit to include other options.
    If we don't provide alternatives, were wrong.......if we do, were still
    wrong.
    Sorry, that wasn't directed at you....just an observation in general.
    --
    Michael Mitchelson


    "malik641" wrote:

    >
    > Well if he wants a color ONLY for loss...then what I said should be all
    > he needs.
    >
    > Here's an attachment to show you what I mean.
    > Play with C38 (i.e. put "1" or "-1" or "0") and watch cell A1
    > Then select A1 and select Format->Conditional Formatting, and you'll
    > see what I mean.
    >
    > If there's anything that I'm missing, let me know....otherwise I'm
    > pretty sure this is what News Account originally asked for.
    >
    > Let me know
    >
    > Michael Wrote:
    > > Hi Malik
    > > Nothing wrong with your thinking.
    > > The OP would still need to use the formula 3 times in Conditional
    > > Formatting
    > > though.
    > > One for win, one for loss, and one for draw
    > > But, that's why we are all here helping each other.......'cause we
    > > think
    > > differently.
    > > Regards
    > > Michael Mitchelson
    > >
    > >

    >
    >
    > +-------------------------------------------------------------------+
    > |Filename: Conditional Format Test.zip |
    > |Download: http://www.excelforum.com/attachment.php?postid=3649 |
    > +-------------------------------------------------------------------+
    >
    > --
    > malik641
    >
    >
    > ------------------------------------------------------------------------
    > malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190
    > View this thread: http://www.excelforum.com/showthread...hreadid=390126
    >
    >


  10. #10
    Forum Contributor
    Join Date
    06-10-2005
    Location
    Central Jersey
    Posts
    117
    I agree. And I'm glad to see I didn't miss anything
    Quote Originally Posted by Michael
    If we don't provide alternatives, were wrong.......if we do, were still
    wrong.

+ 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