My situation is this. I have an excel sheet that contains 6 columns I need to compare G:L,
in these columns each cell contains a Dollar value or are Blank.
I need to figure out how I can return into column M 3 distinct values
ALL cells within a row Match
The row Contains Blanks
NOT all rows Match
I used =NOT(STDEV(G3:L3))
which gave me True / False / #DIV/0! but when I tried conditional formatting with 3 Rules
Formula:=$M4:$M2693=TRUE (background GREEN) Applies to =$A$4:$L$2693
Formula:=$M4:$M2693=FALSE (background RED) Applies to =$A$4:$L$2693
Formula:=$M4:$M2693=#DIV/0! (background YELLOW) Applies to =$A$4:$L$2693
I would get no Yellow rows, DIV/0 Rows would be the colour of what ever row was above them.
I figure if I can have column M return 3 distinct values be they A, B C 1,2,3 or anything that isn't #DIV/0! I should be able to make conditional formatting work
BONUS is if I can have it return 4 values the 4th value indicating ALL rows are Blank, since that would be heading rows but it doesn't really matter as I can manual edit those 40ish rows.
* EDIT *
Tom Lead me in the right direction, but to get the formatting perfectly I did have to make a few modifications
=COUNTBLANK($H$3:$L$3)=5 (No Formatting)
=STDEV($H3:$L3)>0 (Red)
=STDEV($H3:$L3)=0 (Green)
=COUNTBLANK($H3:$L3)<5 (Yellow)
Then it worked fantastically, So if you're reading this because you have the same problem tweeking the order can have a lot to do with your conditional formatting
OK I have four rules to be fired in this order:-
=COUNT($G4:$L4)=0 - no format set
=COUNT($G4:$L4)<6 - yellow
=STDEV($G4:$L4)>0 - red
=STDEV($G4:$L4)=0 - green
After entering them in Conditional Formatting I used Manage Rules, setting the rules in this order and ticking the stop on error box so they behaved properly.
It's true that STDEV will give a #DIV/0! error if it has less than two numbers to work on, but that doesn't matter because it will be covered by the 'yellow' case and even if it wasn't it would just mean that it wouldn't fire.
A formula to give values for a helper column would look like this:-
=IF(COUNT($G4:$L4)=0,1,(IF(COUNT($G4:$L4)<6,2,(IF(STDEV($G4:$L4)>0,3,4)))))
Related
The conditional format rule is set as an equation doesn't behave as I expect (highlight only values that are =1 in Column M corresponding to the current row). Instead they are seemingly randomly colored.
My code is as follows:
IF($M5=1,TRUE,FALSE)
where true results in the color green, false default formatting. This formatting is copied along a column, e.g. I also expect the value M$5 to correspond with the row in the cell with formatting in column M.
I observed that the color changes sometimes when Mrow=1, sometimes not.It appears uncorrelated with the row value. See below.
Item M-column Color
#1. 1 none
#2 0.48 green
#3. 0.0. green
#4 1. green
Any suggestions to understand what to try next to fix the probelm?
Thanks
Your formula is offsetting the row by 5, either use =$M1=1 or use the conditional formatting dropdown options to select highlight cells -> Equal to...
Based on the data provided it looks like your raw data has a 1 in rows 8,9,10, which is why it formatted the cells five rows above as green.
Also, you don't need to wrap your logical test in an IF() statement, it will return TRUE or FALSE either way.
I'm having trouble using Conditional Formatting in Excel. No problem with setup for one row, but no luck replicating it to the rest of the worksheet.
A B C D
1 MATCH_RESULT CODE DESCRIPTION CHECKUP
2 #N/A A1 Chair #N/A
3 #N/A B1 Window #N/A
4 2 C1 Table #N/A
The goal is to identify if column A is filled with value #N/A (default error message for MATCH function). If it is, cells in columns - A, B, C - ONLY ON THE SAME ROW should be formatted (with color red). I.e. as per example, A2:C3 should be formatted.
This is working for me, however just for the first row and I fail to correctly replicate this downwards.
I'm selecting A2:C2 -> Conditional Formatting -> New Rule -> Use a formula to determine which cells to format.
I will end up with the formatting setup such as:
Formula: =$A$2=$D$2
Applies to: =$A$2:$C$2
A2 through C2 will be formatted, as expected (due to A2=D2). However I can't replicate the same thing on next rows. Format painter function will expand the current functionality so that still A2=D2 match is looked at for formatting other rows, instead of A3=D3 and so on.
Pretty sure the key is in $, but nothing has worked yet. Also pretty sure Excel allows just one cell in column D to be populated with value #N/A for comparison.
You have three issues, first your range is (part of) a single row =$A$2:$C$2. Try selecting ColumnsA:C before adding the rule, or change Applies to to:
=$A:$C
Second, you have anchored the row references in your formula. The 'style' should be:
=$A1=$D1
However your third issue is that comparing errors (#N/A resulting from a function) returns ... #N/A (so I don't know how you managed to get even a single row to work, since CF needs a TRUE result to trigger).
Maybe try:
=AND(ISNA($A1),ISNA($D1))
Replace the formula part with
=iserror($A2)
you may need to remove the $ manually.
Suppose I have the following table:
Date Value
5/27/2017 5
6/10/2017 7
6/24/2017 8
7/8/2017 5
7/22/2017 10
I want to highlight the most recent row, meaning the row with the date closest to today. I know I need to use Excel's conditional formatting capability, so I created the indicator column _inRange, which derives from this function:
=IF(AND(A2 <= TODAY()), TODAY() < A3), 1, 0)
The new table:
Date Value _inRange
5/27/2017 5 0
6/10/2017 7 0
6/24/2017 8 1
7/8/2017 5 0
7/22/2017 10 0
So, where _inRange equals 1, the row should be highlighted. I can highlight the _inRange cell properly, but am having difficulties highlighting the entire row. Can anyone provide direction here? I looked at this Exceljet post but obviously was left with questions.
Edit:
I changed _inRange to boolean (I don't think boolean TRUE/FALSE versus 1-0 is the main issue, though) and am still having issues:
Date Value _inRange
5/27/2017 5 FALSE
6/10/2017 7 FALSE
6/24/2017 8 TRUE
7/8/2017 5 FALSE
7/22/2017 10 FALSE
Here's a picture of my conditional formatting window:
I first select the entire table, then go to Home > Conditional Formatting > Highlight Cells Rules > Equal To and set the value as TRUE. Then I change the column as E. Trauger suggested but nothing changes.
In the Conditional Formatting Rules Manager (Home->Conditional Formatting->Manage Rules...) make sure your conditional format is correct in the "Rule" Column and then make sure the "Applies to" column is also correct. I suspect this is your problem.
Try changing the rule to: =$C2=1
And change range of application to: =$A$2:$C$10 (or whatever the C column goes to)
The way I would do this would be to use the conditional formatting on the entire row, where for any cell in that row, it is going to check the _inRange of that row. Something like this, after New Formatting Rule --> Use a Formula to Determine which cells to format:
=INDEX(C:C,ROW())=1
Replace C:C with whatever column _inRange is in, and apply the formatting to the entire table.
I may be going about this the wrong way so if someone has an alternative method let me know.
I have two columns of values. Column A has values spanning -5 to 5 and column B has values from 1 to zero. My goal is to indicate which rows have both a Column A value of either <-1 or >1 and a Column B value <0.05. My current Excel function is:
=COUNTIFS(A1,">1",B1,"<0.05")+COUNTIFS(A1,"<-1",B1,"<0.05")
This works in that it returns a 1 if either of the criteria are met however it does not tell me which criteria was met so I was wondering if there was a way to color code the results so that if the first was met (>1 and <0.05) the cell would be green and if the second was met (<-1 and <0.05) it would be red.
Use conditional formatting.
You can put several rules there. In your case they would be (assuming that values are in cells A1:B10):
Rule 1: =AND($A1>1;$B2<0.05) , Color: Green , Range: =$A$1:$B$10
Rule 2: =AND($A1<-1;$B2<0.05) , Color: Red , Range: =$A$1:$B$10
These rules will color whole row, i. e. cells in column A as well as in column B.
Please, note, that, in order to make formula work correctly, column address is locked with $ (if it would be absent, rule 1 formula for cell A1 would work like =AND(A1>1;B2<0.05) , and for column B1 - like =AND(B1>1;C2<0.05), which is not what we need)
P. S. In complex situations when there are overlapping rules (which is not your case), you can make set of conditional formatting rules work correctly by adjusting their order, or by setting "[ ] Stop If True" checkbox.
For example: in a row(A1:Z1) I have A1=1, D1=1, and F1=2, K1=2, and O1=3, U1=3
I want a conditional format that will color the empty cells based on the values of the cell ranges A to D, then from F to K and finally from O to U.
I'm using the following formatting and it works with cells that have a value of 1, but it isn't working for 2, 3 or any other cell values.
=COUNTIF(A1:Z1,1)=1
I have already tried replacing 1 in above formula with 2 and 3 but it doesn't work.
Can someone help me with the formatting?
Waqas
The link seems dead so somewhat guessing the requirements (eg no overlaps) I suggest three rules (to allow a different colour for each) for blanks between 'bookends' of 1s, 2s and 3s, in A1:
=AND(A1<>1,A2<>1,COUNTIF(A1:$Z1,1)=1)
=AND(A1<>2,A2<>2,COUNTIF(A1:$Z1,2)=1)
=AND(A1<>3,A2<>3,COUNTIF(A1:$Z1,3)=1)
each with Applies to =$A$1:$Z$1.