Conditional Formatting entire worksheet with case sensitive text - excel

I have an Excel worksheet that I would like to use conditional formatting on to change text color. The problem that I am having is that it uses genetics so I need formatting to be case sensitive. Ie:
dd=red
Dd=yellow
DD=green
Right now I am using conditional formatting > format cell that contains > specific text. That isn't case sensitive so anything with two d's in it, regardless of case, turns the color red. I tried to google and found a few things:
1) use "exact" which when I did this said it was incorrect. I tried same as above but used
=EXACT("dd")
instead of just dd. It tells me to use a valid formula.
2) version 2003, which is the only option I have at work, isn't case sensitive compatible - is this true and if so is it easy to figure out how to define that I want case sensitive in newer versions?
3) use a macro
Am I just SOL with my old version of Excel?

Select the option "use a formula" and enter
=EXACT(A1,"dd")
where A1 is the first cell in the area where you're applying your CF

Related

Excel Conditional Formatting Nest AND and OR

I have a rather quick hopefully not too complicated question for you guys. I'm trying to use conditional formatting where I want a cell to turn red if the following statements are False or If the conditions are not met.
I'm using the Formula for Conditional formatting where you have to input it manually. The real problem I'm having is using a nested AND and OR.
Here's the formula I have for conditional formatting (one thing to note that, maybe I could be wrong, but my 2013 Excel is treating OR as an AND and vice versa. I've tested it many times and this is the case, so the formula you see below treats OR and AND as I mentioned. In short, pretend that AND is OR and OR is AND. But if it confuses you, just go with the correct convention:
=AND(OR(SUM(A1:A5)=0,SUM(B2:B5)=0),OR(SUM(C1:C5)=0,SUM(D1:D5)=0),SUM(E1:E5)=0)
So basically, say I have cell 'A7'. I want 'A7' to be red until there's a number in
Both A1:A5 and B2:B5 or:
E1:E5 or;
Both C1:C5 and D1:D5 -----> here's where it doesn't work.
Points 1 and 2 above work as desired, but when I add the second 'OR' it doesn't work. Remember, for some reason my Excel COnditional Formatting treats OR like and AND and vice versa so when I say:
OR(SUM(A1:A5)=0,SUM(B1:B5)=0)
It treats it like an AND where both conditions must be true, therefore, I've been following this convention.
So basically how do I have more that one OR statements within AND as shown above.
I hope I made the question clear. Appreciate your guys help!! If you can also tell me a general rule on how nested And OR works, that would be helpful.
Thank you!
Select A7, fill it with red colour (standard fill), clear any existing CF from it and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=OR(COUNT(E1:E5),AND(COUNT(A1:A5),COUNT(B2:B5)),AND(COUNT(C1:C5),COUNT(D1:D5)))
Format..., select No Colour fill, OK, OK.
Try this =IF(OR(AND((SUM(A1:A5)>0),(SUM(B2:B5)>0)),SUM(E1:E5)>0,AND((SUM(C1:C5)>0),(SUM(D2:D5)>0)))=FALSE,TRUE,FALSE)
I put this into a cell first and used the Evaluate Formula before pasting it into the Conditional rule.
Set the text to be red if this is true.

Using an array based formula in conditional formatting

What I am trying to do with excel is a bit unorthodox, but I need a method of cleaning the data people import in to TechExcel's DevTrack. DevTrack creates values for fields if what you attempt to import is not 100% accurate to what exists already in the project, leading to duplicate values with slightly different formatting.
What I have come to is having a "validator" excel sheet; people copy/paste what they want to import, and anything that doesn't match a data validation table is highlighted.
Data validation itself does not work because copy/paste overwrites it and it is a waste of time to enter data manually.
I have managed to get conditional formatting working partially using this formula:
=ISERROR(MATCH(C5,D:D,0))
However it is not case sensitive. I need case sensitivity.
So I managed to create another formula which shows true if there is no match, however exact requires it to be an array formula which doesn't seem to work with conditional formatting.
So this works if it is entered in to a cell with ctrl+shift+enter, but doesn't work as a conditional rule.
{=ISERROR(MATCH(TRUE,EXACT(C5,D:D),0))}
Here is a simplified version of what I'm looking at for testing. That formula is true when there is no case match, but I can't enter it in conditional formatting with ctrl+shift+enter. If this worked as I want it to, the lower case "melon" would highlight red.
Is there a way to get this working, or is there an alternative method to do this?
If it matters, I'm using the latest version of excel in office 365.
Use a function that produces array processing without CSE. Examples are SUMPRODUCT or AGGREGATE (among others).
'to show TRUE for case-sensitive matches
=SIGN(AGGREGATE(15, 6, ROW($D$5:$D$9999)/EXACT($C5, $D$5:$D999), 1))
'to show TRUE on no case-sensitive match
=ISERROR(AGGREGATE(15, 6, ROW($D$5:$D$9999)/EXACT($C5, $D$5:$D999), 1))
The SIGN wrapper is unnecessary but for me it is a visual reminder that I'm looking for a boolean.
You cannot use dynamic ranges like D5:INDEX(D:D, MATCH("zzz", D:D)) in a CFR and you do not want to use full column references in AGGREGATE (or SUMPRODUCT) so I opted for $D$5:$D$9999.

Conditional Formatting exact text match

I have several spreadsheets where I want to highlight all the rows where the data matches a separate list. I have used a rule for this but it's not highlighting it exactly; it's just matching part of the word, for example General manager in one list is highlighting Manager in the other list whereas I would only want it to highlight General manager.
This is the formula I've used:
=COUNTIF(A92:A400,L2:L196)
and I've also tried MATCH but it pulled out out even more incorrect matches.
You will have to bring in the EXACT function somewhere.
    
This CF rule was created by selecting A1:D7 and creating a rule based upon the following formula,
=AGGREGATE(15, 6, ROW(1:1)/EXACT($A1, $F$8:$F$10), 1)
The way I interpret the question is that case sensitivity may not be required, rather that use of wildcards may be causing issues (ie that exact text match is not applying "exact" in quite the same way the EXACT function does). If the separate list is the one in ColumnL then please select from A92 to A400 and HOME > Styles - Conditional Formatting, New Rule..., Use a formula to determine which cells to format and Format values where this formula is true::
=COUNTIF(L$2:L$196,A92)
Format..., select your choice of highlighting, OK, OK.
If to be applied to several sheets it may be convenient to Name the L2:L196 range.
The above highlights cells rather than rows, but that could be adjusted.

Writing a Conditional Format Formula in Excel

I am trying to write a rule in vba to trigger a Conditional Format, but I have my doubts if I am writing it correctly.
The condition for the format would be, if the cell value of a range is equal to the cell value of the same range on a different sheet:
=M7=Original!M7
This is to applied for all cells in a range (M7:BZ5000) [5000 is a large outer bound number to help conserve memory].
The issue that has me perplexed is how do I tell vba that M7=Original!M7, M8=Original!M8, Z143=Original!Z143, etc.
I feel this is a pretty basic concept but I searched these forums and could not find an answer that I think applies to my issue.
Also, Since I Would want this conditional format to trigger at the press of a button, how would I tell it to deactivate, WITHOUT removing the rest of my conditional formats (I have normal conditional formats applied to the range and want them to remain whenever the button isn't pressed.
Sheets("Main").Select
Range("M7:BZ5000").Select
For Each Cell In Selection
If Cell.Interior.Color = Excel.XlRgbColor.rgbBlack Then
Cell.Clear
End If
Next
You are using the conditional formatting choice of "Use formula to determine which cells to format"
The formula you will need is going to be like this (note the use of $ signs to control how the formula changes. The $ stops the value after it from changing)
=AND($M7=Original!$M7,$G$4="Y")
Note $G$4 is a cell you can use to turn on and off the cond. formatting. When it is "Y" the formatting will work, otehrwise any formatting you have applied will JUST be shown.
If you don't want you formatting to show when conditional formatting is on, then your conditional formatting MUST have formats the remove yours and sets them to the "default" settings.

Conditional Formatting (IF not empty)

How do I conditionally format a cell so if not blank it is grey?
I tried to do 'not equal', but it didn't work.
I am using Windows Office 2003 with Windows XP at work. I don't see the same feature as below:
What I have tried so far:
Edit: Figured what was wrong. In my production (actual work Excel), they were filled with white color. It wasn't my Excel file, so I was not aware of this before.
Does this work for you:
You find this dialog on the Home ribbon, under the Styles group, the Conditional Formatting menu, New rule....
You can use Conditional formatting with the option "Formula Is". One possible formula is
=NOT(ISBLANK($B1))
Another possible formula is
=$B1<>""
In Excel 2003 you should be able to create a formatting rule like:
=A1<>"" and then drag/copy this to other cells as needed.
If that doesn't work, try =Len(A1)>0.
If there may be spaces in the cell which you will consider blank, then do:
=Len(Trim(A1))>0
Let me know if you can't get any of these to work. I have an old machine running XP and Office 2003, I can fire it up to troubleshoot if needed.
This worked for me:
=NOT(ISBLANK(A1))
I wanted a box around NOT Blank cells in an entire worksheet.
Use the $A1 if you want the WHOLE ROW formatted based on the A1, B1, etc result.
Thanks!
This method works for Excel 2016, and calculates on cell value, so can be used on formula arrays (i.e. it will ignore blank cells that contain a formula).
Highlight the range.
Home > Conditional Formatting > New Rule > Use a Formula.
Enter "=LEN(#)>0" (where '#' is the upper-left-most cell in your range).
Alter the formatting to suit your preference.
Note: Len(#)>0 be altered to only select cell values above a certain length.
Note 2: '#' must not be an absolute reference (i.e. shouldn't contain '$').
An equivalent result, "other things being equal", would be to format all cells grey and then use Go To Special to select the blank cells prior to removing their grey highlighting.

Resources