Conditional Formatting Query

chandelirious

Board Regular
Joined
Sep 9, 2004
Messages
84
Hi,

I'm putting a spreadsheet together that will compare National results with local scores.

I think Conditional Formatting is what I need for this, but I'm not sure exactly what formula to use.

The attached image displays what I'm working with, and the colour scheme that I need to implement.

So for example, KPI 1 is 70.

Location 1's KPI 1 score is 76, so as that is actually above the National result, I would want that cell to be coloured green.

The scoring system would go like this:

Anything from 3 points below and above National, the cell would be coloured green.

Between 4 and 10 points below National, the cell would be coloured yellow.

Between 11 and 19 points below National, the cell would be coloured red.

Anything that is 20 points or more below National, the cell would be coloured purple... I know.

I know how to use conditional formatting to change the colour based on a set value, but I can't figure out how to do it based on the value in a cell.

I just used RANDBETWEEN to fill the cells - I just want to get this working in draft before I begin work on the main spreadsheet, which has 93 locations!

Thanks very much for your help.
 

Attachments

  • Conditional Formatting for Results.png
    Conditional Formatting for Results.png
    24.4 KB · Views: 12

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
The model to follow is the option "Use a formula to determine which cells to format." Select the cells for all locations (from D12 to K whatever-the-last-row-is) and use formulas like this:

Green
=D12>=D$9-3

Yellow
=D12>=D$9-10

and so forth.

If you provide an actual table of data instead of a picture I could provide a sample file but I am not going to type in all your data from scratch.
 
Upvote 0
does this work for you

Book2
ABCDEFG
1
2Anything from 3 points below and above National, the cell would be coloured green.
3
4Between 4 and 10 points below National, the cell would be coloured yellow.
5
6Between 11 and 19 points below National, the cell would be coloured red.
7
8Anything that is 20 points or more below National, the cell would be coloured purple... I know.
9
10National 70569886
11
12Loc1861709
13Loc268639230
14Loc396377113
15Loc45273291
16Loc559484993
17Loc666685285
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D12:G17Expression=D12>=D$10-3textYES
D12:G17Expression=D12>=D$10-10textYES
D12:G17Expression=D12>=D$10-19textYES
D12:G17Expression=D12<=D$10-20textYES


Book2
ABCDEFGHI
1
2Anything from 3 points below and above National, the cell would be coloured green.
3
4Between 4 and 10 points below National, the cell would be coloured yellow.
5
6Between 11 and 19 points below National, the cell would be coloured red.
7
8Anything that is 20 points or more below National, the cell would be coloured purple... I know.
9
10National 70569886
11
12Loc17093979
13Loc299672143
14Loc3848157
15Loc461195448
16Loc513124767
17Loc66834445
18
19
20
21
22
Sheet1
Cell Formulas
RangeFormula
D12:G17D12=RANDBETWEEN(1,100)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D12:G17Expression=D12>=D$10-3textYES
D12:G17Expression=D12>=D$10-10textYES
D12:G17Expression=D12>=D$10-19textYES
D12:G17Expression=D12<=D$10-20textYES


Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed
 
Upvote 0
Solution
does this work for you

Book2
ABCDEFG
1
2Anything from 3 points below and above National, the cell would be coloured green.
3
4Between 4 and 10 points below National, the cell would be coloured yellow.
5
6Between 11 and 19 points below National, the cell would be coloured red.
7
8Anything that is 20 points or more below National, the cell would be coloured purple... I know.
9
10National 70569886
11
12Loc1861709
13Loc268639230
14Loc396377113
15Loc45273291
16Loc559484993
17Loc666685285
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D12:G17Expression=D12>=D$10-3textYES
D12:G17Expression=D12>=D$10-10textYES
D12:G17Expression=D12>=D$10-19textYES
D12:G17Expression=D12<=D$10-20textYES


Book2
ABCDEFGHI
1
2Anything from 3 points below and above National, the cell would be coloured green.
3
4Between 4 and 10 points below National, the cell would be coloured yellow.
5
6Between 11 and 19 points below National, the cell would be coloured red.
7
8Anything that is 20 points or more below National, the cell would be coloured purple... I know.
9
10National 70569886
11
12Loc17093979
13Loc299672143
14Loc3848157
15Loc461195448
16Loc513124767
17Loc66834445
18
19
20
21
22
Sheet1
Cell Formulas
RangeFormula
D12:G17D12=RANDBETWEEN(1,100)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D12:G17Expression=D12>=D$10-3textYES
D12:G17Expression=D12>=D$10-10textYES
D12:G17Expression=D12>=D$10-19textYES
D12:G17Expression=D12<=D$10-20textYES


Note: Images are difficult to see , and also requires that I input all the data myself, which is very time consuming.

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC , then put the sample spreadsheet onto a share
I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed
Thank you for this, I appreciate it.

I did download XL2BB, however, restrictions on my work laptop prevented me from installing it. I didn't really consider using a shared drive, I may do that in the future if I can't get around XL2BB.

Thanks again.
 
Upvote 0
ok,
did those conditional formatting formulas solve the issue
Note they are placed in the order shown and use stop of true
 
Upvote 0

Forum statistics

Threads
1,214,383
Messages
6,119,196
Members
448,874
Latest member
Lancelots

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