Conditional formatting using arrays

Sharksfan

New Member
Joined
Nov 3, 2017
Messages
22
I have 2 arrays that are 6 x 6. I would like to conditional format the cells in the first array based on whether the corresponding values in the second array are less than 15% (in green) or greater than or equal to 15% (in red). Below is an example of the 2 arrays. The first row is column labels in each array The first array is located at H2:M8. The second array is located at V2:AA8. A wrinkle, but not required, would be if the percentage is 0% in array 2, then the corresponding cells in array 1 would remain un-formatted. I have searched the web and haven't struck gold, short of creating 2 conditional formatting rules for each cell in the first array based on the corresponding value in the second array (72 rules!)

Thank you,

Bob

FCP1 FCP1-2 FCP1-3 FCP1-4 FCP1-5 FCP1-6
$94,045.69$191,278.70$319,858.32$432,699.87$558,319.13$666,303.19
$0.00$0.00$0.00$0.00$0.00$0.00
$27,230.28$57,828.63$91,347.81$123,487.03$156,320.82$189,571.23
$11,569.16$22,314.54$35,165.74$48,522.11$61,103.96$73,925.00
$198,074.58$248,835.31$637,667.82$872,446.90$1,112,233.06$1,340,813.76
$0.00$0.00$0.00$0.00$0.00$0.00

<tbody>
</tbody>



FCP1FCP1-2FCP1-3FCP1-4FCP1-5FCP1-6
1.1%1.5%4.0%8.8%14.4%20.3%
0.0%0.0%0.0%0.0%0.0%0.0%
2.0%3.9%9.4%15.6%23.1%30.0%
8.9%11.3%17.8%25.7%32.6%38.7%
2.4%3.7%4.2%8.1%13.5%19.1%
0.0%0.0%0.0%0.0%0.0%0.0%

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Welcome to the board.

Select H3:M8. Click Conditional Formatting > New Rule > Use a formula > and enter

=V3<15%

select a green fill color. Repeat the process with

=V3>=15%

and a red fill color. It's a matter of selecting the right range, and creating the formula based on the upper left cell in the range. Excel will adapt the formula for the rest of the range. Let us know how it works.

Edit: To not format cells with a zero value, use this formula for green:

=AND(V3<15%,V3<>0)

The red formula doesn't need changing.
 
Last edited:
Upvote 0
This worked! A coworker and I struggled for hours yesterday with this. Thank you!

Bob

Welcome to the board.

Select H3:M8. Click Conditional Formatting > New Rule > Use a formula > and enter

=V3<15%

select a green fill color. Repeat the process with

=V3>=15%

and a red fill color. It's a matter of selecting the right range, and creating the formula based on the upper left cell in the range. Excel will adapt the formula for the rest of the range. Let us know how it works.

Edit: To not format cells with a zero value, use this formula for green:

=AND(V3<15%,V3<>0)

The red formula doesn't need changing.
 
Upvote 0
Conditional Formatting is very useful, but sometimes it takes a while to wrap your head around how it works.

Glad to help! :cool:
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,876
Members
449,056
Latest member
ruhulaminappu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top