+ Reply to Thread
Results 1 to 18 of 18

Change cell colour with IF formula

  1. #1
    Registered User
    Join Date
    12-20-2016
    Location
    Hampshire
    MS-Off Ver
    Office for Mac 2016
    Posts
    9

    Change cell colour with IF formula

    I want to change a blank cell next to a value in another cell to show a colour.

    I am thinking =IF(E5>90,"green","red")

    The formula would be written in E6 next to the value in E5.

    Can i do this to show the colour green or red next to the value to say if it is higher or lower than 90?

    Thanks for comments.

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Change cell colour with IF formula

    Try using Conditional Formatting

    Select E6
    Goto Conditional Format-->new rule-->Using a formula
    =E5>90
    format as green
    new rule
    =AND(E5<=90,E5<>"")
    format as red

  3. #3
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Change cell colour with IF formula

    use conditional formatting to change the colour

    you are looking at the cell row beneath

    so is this JUST E6
    or are other cells involved

    select E6
    goto conditional formatting
    enter two rules
    using

    =E5>90
    format Green

    next rule
    =E5<=90
    format RED
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  4. #4
    Forum Expert
    Join Date
    03-20-2015
    Location
    Primarily UK, sometimes NL
    MS-Off Ver
    Work: Office 365 / Home: Office 2010
    Posts
    2,405

    Re: Change cell colour with IF formula

    If you want the word green or red, then your formula is fine.
    (Though consider what you want if E5 is equal to 90 - if you want green for that, use >= instead of >.)

    If you want the other cell to be filled green or red, use Conditional Formatting. Select the cell, click 'Conditional Formatting' on the 'Home' tab, select 'New Rule' then 'Use a formula to determine which cells to format'. Enter this in the formula box at the bottom of the dialogue box:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Then click the 'Format' box and select green fill.
    Now just fill the cell red using the normal cell colour fill button - it'll then be red whenever E5 isn't >90. (Alternatively, repeat the above with the <90 (or <=90) formula and red fill.)
    Regards,
    Aardigspook

    I recently started a new job so am a bit busy and may not reply quickly. Sorry - it's not personal - I will reply eventually.
    If your problem is solved, please go to 'Thread Tools' above your first post and 'Mark this Thread as Solved'.
    If you use commas as your decimal separator (1,23 instead of 1.23) then please replace commas with semi-colons in your formulae.
    You don't need to give me rep if I helped, but a thank-you is nice.

  5. #5
    Registered User
    Join Date
    12-20-2016
    Location
    Hampshire
    MS-Off Ver
    Office for Mac 2016
    Posts
    9

    Re: Change cell colour with IF formula

    There are more than one cells with values. E5 but under each one I want a color, red or green.

    When I get to Conditional Formating I get a choice of five "Styles" (2 colour scale, 3 colour scale, date bar, icon sets, classic)

    Which one do i choose here to put in any formula?

    The biggest problem is that I dont want to colour the value I want the cell next to it to show the green or red.

  6. #6
    Registered User
    Join Date
    12-20-2016
    Location
    Hampshire
    MS-Off Ver
    Office for Mac 2016
    Posts
    9

    Re: Change cell colour with IF formula

    There are more than one cells with values. E5 but under each one I want a color, red or green.

    When I get to Conditional Formating I get a choice of five "Styles" (2 colour scale, 3 colour scale, date bar, icon sets, classic)

    Which one do i choose here to put in any formula?

    The biggest problem is that I dont want to colour the value I want the cell next to it to show the green or red.

  7. #7
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Change cell colour with IF formula

    are the rows you want to colour all EVEN

    we are using a formula
    should see new rule at the bottom of the menu

  8. #8
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Change cell colour with IF formula

    See the file
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    12-20-2016
    Location
    Hampshire
    MS-Off Ver
    Office for Mac 2016
    Posts
    9

    Re: Change cell colour with IF formula

    Hi Jose Augusto,

    This is what I need, the colour just below if horizontal (or opposite vertical), but how did you do this?

    Thanks for you help Jose.

    Neil88
    Last edited by (Neil88); 12-20-2016 at 08:15 AM. Reason: add text

  10. #10
    Registered User
    Join Date
    12-20-2016
    Location
    Hampshire
    MS-Off Ver
    Office for Mac 2016
    Posts
    9

    Re: Change cell colour with IF formula

    No they are not even, for example the values would be next to each other in a row (or below each other vertically)
    (E5) (F5) (G5)
    100 89 78
    Green Red Red

    Usually it just lets you colour the cell witht he number in it but i want it just below in a row (or to the right vetically).

  11. #11
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Change cell colour with IF formula

    but i want it just below in a row (or to the right vetically).
    how do you decide which cell ? any rules , that could be applied to excel ?

    this is sounding more like a VBA solution ,

    you have E5, F5 and G5 with a number in
    will all the colours be in row ^ or
    H5 for G5 ?

  12. #12
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Change cell colour with IF formula

    Hi

    When you create or manage a rule in a CF you can apply that to a range e.g. E6:M6. You can also copy the format in E6 and paste them to E6:M6.

  13. #13
    Registered User
    Join Date
    12-20-2016
    Location
    Hampshire
    MS-Off Ver
    Office for Mac 2016
    Posts
    9

    Re: Change cell colour with IF formula

    so if I had a number in E5, 89, in E6 it would be red because it is lower than 90. Then a number in F5, 99, F6 would be green below.

    If it were vertical, E5, 89, it would be red in F5. Then E6, 99, would be green in F6.

  14. #14
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Change cell colour with IF formula

    and what decides.
    if E5 is 89
    do you colour E6 or F5 ?
    how do you decide which cell to colour ?

  15. #15
    Registered User
    Join Date
    12-20-2016
    Location
    Hampshire
    MS-Off Ver
    Office for Mac 2016
    Posts
    9

    Re: Change cell colour with IF formula

    89 is just a number which could relate to anything, this is in E5 and I want to know if it is greater or less than 90 and the result would be below it in E6. The result of whether it was greater or less than 90 would show up in E6 as red. Then (in a row) the next number in F5 which is 95, this is greater than 90 so F6 would be green.

    If i were doing this vertically E5 number (89) and F5 colour red and E6 number, F6 colour.

  16. #16
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.83 (24031120))
    Posts
    8,734

    Re: Change cell colour with IF formula

    If i were doing this vertically
    so these are separate spreadsheets you would do this to
    not the same one

    we have replied with the rules for colouring the cells

    and José Augusto has posted an example and how to setup

    did you follow and manage to reproduce that rule on your spreadsheet ?

  17. #17
    Registered User
    Join Date
    12-20-2016
    Location
    Hampshire
    MS-Off Ver
    Office for Mac 2016
    Posts
    9

    Re: Change cell colour with IF formula

    Ok i have got it now. Thanks everyone for your help.

    I went down to the 'classic style" to put in the formulas there.

  18. #18
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: Change cell colour with IF formula

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. How to change cell colour, if the colour is based on value from formula?
    By darah237 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-19-2016, 11:40 AM
  2. change cell colour for all cells in sheet containing formula's
    By Robert1311 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-18-2015, 09:17 AM
  3. Change cell colour by formula
    By johnandrews in forum Excel General
    Replies: 11
    Last Post: 12-14-2013, 06:19 AM
  4. [SOLVED] Can I change a cell colour using an IF formula, not conditional formatting?
    By suxrule in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-29-2012, 10:52 AM
  5. Using VB Code to change cell colour on back of formula
    By Twaddy in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 09-30-2010, 04:29 PM
  6. Formula to change cell colour
    By Chuckie1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-30-2009, 01:19 AM
  7. Change cell colour based on formula result
    By fixednfinal in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 04-29-2005, 05:29 PM

Tags for this Thread

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