+ Reply to Thread
Results 1 to 8 of 8

conditional formatting or VBA to display text

  1. #1
    Forum Contributor
    Join Date
    08-24-2011
    Location
    Van Wert, Ohio
    MS-Off Ver
    Excel 2010, 2000
    Posts
    104

    conditional formatting or VBA to display text

    Bear in mind I am working with Excel 2000

    If cell D4 has a 90 or above, I want cell C4 to highlight in green, but I also want the cell to display the word green. I know how to do the former, but the latter perplexes me a bit.

    Any suggestions?

    Thanks in advance

  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: conditional formatting or VBA to display text

    You would have to enter a formula in cell C4. Something like this...

    =IF(N(D4)>=90,"Green","")

    Or, this very robust version:

    =IF(ISNUMBER(D4),IF(D4>=90,"Green",""),"")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Contributor
    Join Date
    08-24-2011
    Location
    Van Wert, Ohio
    MS-Off Ver
    Excel 2010, 2000
    Posts
    104

    Re: conditional formatting or VBA to display text

    Quote Originally Posted by Tony Valko View Post
    You would have to enter a formula in cell C4. Something like this...

    =IF(N(D4)>=90,"Green","")

    Or, this very robust version:

    =IF(ISNUMBER(D4),IF(D4>=90,"Green",""),"")

    Pretty clever Tony, what if i wanted to add another variable, so that any number between 80-89 will display the text "yellow"

    Thanks

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

    Re: conditional formatting or VBA to display text

    Like this...

    =IF(ISNUMBER(D4),IF(AND(D4>=80,D4<=89),"Yellow",IF(D4>=90,"Green","")),"")

  5. #5
    Forum Contributor
    Join Date
    08-24-2011
    Location
    Van Wert, Ohio
    MS-Off Ver
    Excel 2010, 2000
    Posts
    104

    Re: conditional formatting or VBA to display text

    Quote Originally Posted by Tony Valko View Post
    Like this...

    =IF(ISNUMBER(D4),IF(AND(D4>=80,D4<=89),"Yellow",IF(D4>=90,"Green","")),"")
    Thanks a bunch and one last bit of help if you don't mind

    I am trying to add one last variable for Red, but something is not quite right. I keep getting a value message.

    =IF(ISNUMBER(D4),IF(AND(D4>=0,D4<=79,"Red",IF(D4>=80,D4<=89),"Yellow",IF(D4>=90,"Green","")),""))

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

    Re: conditional formatting or VBA to display text

    Like this...

    =IF(ISNUMBER(D4),IF(D4>=90,"Green",IF(D4>=80,"Yellow",IF(D4>=0,"Red",""))),"")

  7. #7
    Forum Contributor
    Join Date
    08-24-2011
    Location
    Van Wert, Ohio
    MS-Off Ver
    Excel 2010, 2000
    Posts
    104

    Re: conditional formatting or VBA to display text

    Awesome!!!

    Thanks a bunch.
    Go Bangels!!!!!

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

    Re: conditional formatting or VBA to display text

    You're welcome. Thanks for the feedback!

+ 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