+ Reply to Thread
Results 1 to 4 of 4

Conditional formula based on previous columns

  1. #1
    Registered User
    Join Date
    07-30-2020
    Location
    London
    MS-Off Ver
    365
    Posts
    46

    Conditional formula based on previous columns

    This is probably a nice easy one... (three questions/parts)

    Table of numbers.

    1:
    If values in column B = 0, colour green,
    If values in column B > column A, colour red
    If values in column B < column A (but <>0), colour amber

    2:
    How do I copy the above so the same rules apply in respective columns, i.e. B compared to A, C compared to B, D compared to C... I tried format painter with no luck (am I doing it wrong?)

    3:
    How do I colour scale the above formulae?
    i.e.:
    If column B is 0, colour green,
    If values in column B ≥ column A, colour amber to red based on the previous values in that row
    If values in column B ≤ column A, colour amber to green based on the previous values in that row

    ...and likewise copy to other cells
    Attached Files Attached Files
    Last edited by beternal; 06-28-2021 at 10:55 AM. Reason: attachment

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,372

    Re: Conditional formula based on previous columns

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.

    Office 2006 or MS365? Please update your profile if the latter.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-30-2020
    Location
    London
    MS-Off Ver
    365
    Posts
    46

    Re: Conditional formula based on previous columns

    Edit: please find attached random grid of numbers to appease admin

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,603

    Re: Conditional formula based on previous columns

    As to numbers 1 and 2:
    1. Change the formula in A1:E20 to read: =RANDBETWEEN(1,30) so that there will be some zero values with which to test the conditional formatting.
    2. Select cells B1:E20
    3. Use formulas for conditional formatting rules > Note that the rule for green needs to be listed before the rule for amber.
    Green: =B1=0
    Amber: =B1<A1
    Red: =B1>A1
    As to number 3 I don't feel that it is possible to scale the colors the way that you want using conditional formatting rules. Perhaps someone whom is fluent in VBA can come up with a solution.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. [SOLVED] Formula to sum every 2 columns based on criteria found in previous column
    By PaulM100 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 07-02-2018, 05:08 AM
  2. Conditional Formatting Formula Based on Text in Previous Cell
    By koricw in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-24-2018, 09:02 AM
  3. Conditional Formatting based on previous worksheet
    By jedbanger2 in forum Excel General
    Replies: 2
    Last Post: 08-07-2017, 03:32 PM
  4. [SOLVED] Indirect Formula to report content based on two previous columns?
    By Amigo1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-11-2014, 08:18 AM
  5. Correct formula for adding columns based on previous row
    By packers316 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-02-2013, 06:44 AM
  6. [SOLVED] Conditional Formula based upon multiple columns
    By KsuGuy26 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-03-2013, 01:13 PM
  7. [SOLVED] Conditional Formatting Formula based on the previous "Last" Monday.
    By avidcat in forum Excel General
    Replies: 3
    Last Post: 09-17-2012, 03:47 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