+ Reply to Thread
Results 1 to 10 of 10

Conditional formatting using if function

  1. #1
    Registered User
    Join Date
    10-15-2017
    Location
    Bangalore, India
    MS-Off Ver
    Ms office 10
    Posts
    35

    Conditional formatting using if function

    Hi There,

    I need to colour the attached excel sheet(D3:H23) using conditional formatting and IF function. Following is the condition. If E3 is greater than D3, colour Green. If E3 less than D3, colour Red. If E3 is blank colour yellow.
    Attached Files Attached Files

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Conditional formatting using if function

    hi there. select the range you want to apply to (say from D3:H23)
    go to Home tab -> Conditional Formatting -> New Rule -> Use a formula to determine which cells to format -> Format values where this formula is true:
    =$E3>$D3
    format green

    but what about those rows in between showing percentage? if you want them like the above, then that works. otherwise, use this instead:
    =AND($E3>$D3,$A3<>"")

    repeat the steps for other colors. Red is:
    =AND($E3<$D3,$A3<>"")

    blank is:
    =AND($E3<>"",$A3<>"")

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    10-15-2017
    Location
    Bangalore, India
    MS-Off Ver
    Ms office 10
    Posts
    35

    Re: Conditional formatting using if function

    Hi,

    Thank you so much for the reply.

    I applied the formula =AND($E3>$D3,$A3<>"") but, it didn't give me the exact result i want. To be clear. If the amount in the cell E3 is greater than the amount in the cell D3, it should colour green. And the amount in the cell F3 is lesser than the amount in the cell E3 it should colour red.

    Likewise, the colouring should be done comparing with the amount in the adjacent cell. Attaching the sheet to let you know what happened when i applied the formula =AND($E3>$D3,$A3<>""). Please let me know if i did anything wrong.
    Attached Files Attached Files

  4. #4
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Conditional formatting using if function

    is that what you want?

    or I misunderstood...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    10-15-2017
    Location
    Bangalore, India
    MS-Off Ver
    Ms office 10
    Posts
    35

    Re: Conditional formatting using if function

    Than you for the reply Sandy.

    But this is not what i need. AIG, EPSILON, JPMC etc are the clients and 12/24/17, 12/31/17, 01/07/18 etc are the week ending dates. The values in dollars are the sales for the particular week. So i need to easily compare the sales with the previous week's sales. If the sales increases compared to the previous week's sales, need to colour green and if the sales are less than the previous week, colour red. And if the sales column is blank, colour yellow.

    For eg : If the sales sales of AIG for the week ending 12/31/2017 (E3) is more than the previous week 12/24/2017(D3), E3 should be in green. If the sales of AIG for 12/31/17 (E3) is less than the previous week 12/24/2017 (D3), E3 should be in red.

    likewise i need to colour E3:Q21. I did the colouring manually in the attached file. Please refer.

  6. #6
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Conditional formatting using if function

    no attached file to post #5

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Cool Re: Conditional formatting using if function

    but maybe this one
    Attached Files Attached Files

  8. #8
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Conditional formatting using if function

    i've uploaded an example of how you should show us your sample sheet under the Manual worksheet. i manually highlighted the results i wish to see. that helps us understand a lot better.

    and in CF worksheet, i did the conditional formatting for you. so the adjustments are now:
    select the range you want to apply to (say from E3:Q24)
    go to Home tab -> Conditional Formatting -> New Rule -> Use a formula to determine which cells to format -> Format values where this formula is true:
    =AND(E3>D3,$A3<>"")
    format green

    repeat for red:
    =AND(E3<D3,$A3<>"")

    blank:
    =AND(E3="",$A3<>"")
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-15-2017
    Location
    Bangalore, India
    MS-Off Ver
    Ms office 10
    Posts
    35

    Re: Conditional formatting using if function

    Thank you all..

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Conditional formatting using if function

    You are welcome

+ 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. Conditional Formatting if function
    By exclusiveleex in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-15-2017, 03:37 PM
  2. Using a function in Conditional Formatting
    By bryanwhalen in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-02-2012, 09:13 AM
  3. AND() function in conditional formatting
    By demonfly100 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-21-2012, 06:03 AM
  4. [SOLVED] Conditional formatting and IF function
    By pjlau in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-30-2012, 10:07 AM
  5. [SOLVED] If function & conditional formatting
    By spursrule68 in forum Excel General
    Replies: 20
    Last Post: 05-31-2012, 08:13 AM
  6. Conditional formatting with NOW() function
    By richbriggs in forum Excel General
    Replies: 3
    Last Post: 05-10-2012, 08:01 PM
  7. IF Function and Conditional Formatting
    By excelRookie06 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-27-2007, 09:16 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