Conditional formatting based on percentage, but changing when adding text.

Dan91

New Member
Joined
Jan 12, 2023
Messages
5
Office Version
  1. 2016
Platform
  1. Windows
Hi Everyone.
I'm trying to work on a sheet to track the books my students are reading. When they have completed a book i wish to fill in their test score. Then based on that score, it will change the background colour of the 'book title' cell.

Book title and completion date in E3 and the test result in F3, the next student will be E4, F4. and so on.

The problem I'm facing is i can get 'book title' cell to change colour based on the percentages i want, but as soon as i put text in that cell it will go red irrelevant of the test score.

100% = green
75 - 99 = orange
under 75 = red
Iv attached screen shots of what iv done if that can help.

Also please note that i also have a macro that will insert two new columns to the right of the book / test result in order to add new books and results when they come through.
Any help or advice would be really appreciated.

Thanks
/Dan
 

Attachments

  • 1.JPG
    1.JPG
    101.8 KB · Views: 27
  • 2.JPG
    2.JPG
    47.7 KB · Views: 26
  • 3.JPG
    3.JPG
    90.9 KB · Views: 30
  • 4.JPG
    4.JPG
    61.4 KB · Views: 25
  • 5.JPG
    5.JPG
    43 KB · Views: 21

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
i would setup 3 rules
select E2:E100 or however rows down you need
Then
GREEN
=$F2=1
Orange
=$F2>=0.75
RED
=AND($F2<0.75,$F2<>"")
put in order
and use STOP IF TRUE - otherwise Orange will override GREEN
you make orange
=AND($F2<1, $F2>=0.75)

for 2007, 2010 , 2013 , 2016 , 2019 or 365 Subscription excel version
Conditional Formatting

Highlight applicable range >>
E2:E100 - Change, reduce or extend the rows to meet your data range of rows

Home Tab >> Styles >> Conditional Formatting
New Rule >> Use a formula to determine which cells to format
Edit the Rule Description: Format values where this formula is true:
=AND($F2<0.75,$F2<>"")

USE - STOP IF TRUE
Format [Number, Font, Border, Fill] FORMAT RED
choose the format you would like to apply when the condition is true
OK >> OK

repeat for other formulas
NOTE you can change the order - arrow top right and then use stop if true

Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

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

Book27
ABCDEF
1
2book1100%
3book280%
4book390%
5book440%
6book580%
7book620%
8book7100%
9book875%
Sheet1
Cells with Conditional Formatting
CellConditionCell FormatStop If True
E1:E9Expression=AND($F1<0.75,$F1<>"")textYES
E1:E9Expression=AND($F1<1, $F1>=0.75)textYES
E1:E9Expression=$F1=1textYES
 
Last edited:
Upvote 0
Solution
Thank you very much! that does seem to be working perfectly for now. the only problem i now face though, is when i want to copy and pate the book title from current to last read, upon pate its clearing the formatting. and it wont give me the options for any special paste.
 
Upvote 0
Please ignore the last message. for some unknown reason paste special wasn't working until after a restart.
But, yeah. Everything seems to be working, im very grateful, thank you!
 
Upvote 0

Forum statistics

Threads
1,215,800
Messages
6,126,980
Members
449,351
Latest member
Sylvine

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