+ Reply to Thread
Results 1 to 5 of 5

Conditional Cell Color Changes and Transactions

  1. #1
    Registered User
    Join Date
    04-14-2008
    Posts
    37

    Conditional Cell Color Changes and Transactions

    Is the following problem feasible in Excel?

    1.1 In columns N and O, color the numbers in both the N and O cells green if, and only if, (a)the N cell's number is greater than O's, AND (b) both N and O cells' values are greater than the preceeding N and O cells' (i.e. a great value than one row higher in the column).

    1.2 In columns N and O, color the numbers in both the N and O cells red if, and only if, (a)the N cell's number is less than O's, AND (b) both N and O cells' values are lesser than the preceeding N and O cells' (i.e. lesser values than one row higher in the column).

    Many thanks for any help with this.
    Last edited by WangDoodle; 09-08-2009 at 08:55 PM. Reason: solved

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Conditional Cell Color Changes and Transactions

    What exactly do you mean by "adjacent cells"? Cells on the same row, but in column M and P?

    Maybe you could post a sample workbook where you can pinpoint which cells should change color on which condition.

  3. #3
    Registered User
    Join Date
    04-14-2008
    Posts
    37

    Re: Conditional Cell Color Changes and Transactions

    Sorry for the confusion. By adjacent, I just mean to color both the N and O cells.

    Here are sample columns M, N and O, respectively, from the worksheet that really consists of 7995 rows, as requested. Of note, column N is a 10-day average of the values in M, whereas O is a 30-day average of the values in M.

    I'm hoping to color both N and O cells either green (when N# becomes greater than O#, and both cell N#>N#-1 and O#>O#-1 --the cells directly above), or red (when N# becomes less than O#, and both cell N#<N#-1 and O#<O#-1 --the cells directly above). But that's not quite all, unfortunately: In row 6, for example, N6 < O6, but N6 > N5 and O6 > O5, so N6 and O6 should not be colored red. N22>022, and both N22>N21 and 022>021, so N22 and O22 should be colored green.

    -44 194 14
    -235 168 18
    -45 130 30
    -198 81 28
    59 68 52
    -20 63 75
    74 40 92
    112 18 104
    349 38 109
    -67 -2 100
    -333 -30 95
    -19 -9 87
    227 18 84
    163 55 84
    -74 41 83
    188 62 86
    202 75 88
    240 88 89
    305 83 104
    137 104 109
    15 138 101
    131 153 104
    290 160 103
    363 180 105
    198 207 105
    -108 177 101
    49 162 92
    159 154 87
    161 140 87
    212 147 83
    303 176 95
    236 186 110
    129 170 116
    -133 121 118
    107 112 120
    387 161 133
    306 187 141
    357 207 149
    181 209 144
    8 188 146
    171 175 163
    Last edited by WangDoodle; 09-08-2009 at 02:28 AM.

  4. #4
    Forum Expert
    Join Date
    08-27-2008
    Location
    England
    MS-Off Ver
    2010
    Posts
    2,561

    Re: Conditional Cell Color Changes and Transactions

    Select N2 to O<bottom of range> (not N1)
    Conditional formatting
    Formula is =AND($N2>$O2,$N2>$N1,$O2>$O1)
    Format is font-colour green
    Add>>
    Formula is =AND($N2<$O2,$N2<$N1,$O2<$O1)
    Format is font-colour red
    OK

    HTH

  5. #5
    Registered User
    Join Date
    04-14-2008
    Posts
    37

    Re: Conditional Cell Color Changes

    Thank you very much Cheeky Charlie! Your instructions are clear and this works.

+ 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