Excel conditional formatting formula not working - excel

I Have a column of numbers C3 to C20 in EXCEL: -0.08, -.07, -.06,...., 0.01, 0.02, 0.03 .... 0.08
$C$1 = .03
I tested my formula =ABS(C3)>$C$1. It gives the correct TRUE and FALSE
but when I use the formula in conditional formatting and apply it to row $C$3:$C20.
it does not work. What am I doing wrong? this is very similar to some basic examples given in tutorials.
the conditional formatting with formula seems to work if I use a formula like =ISODD(ROW()) (which was given in a tutorial). So the conditional formatting is working in that particular case
However I cannot get my formula above to work. I can't figure out why. This is a very simple case. I cannot get it to work even if I use an even simpler formula like =C3>$C$1
Can you help? is there something basic I cannot see or some setting in EXCEL that need to be changed? is it my version of EXCEL that is the problem?

This works:
with this condition:
=ABS($A1) > $A$1
The $ in ABS is optional to prevent any expansion by columns, because you want to apply the rule only to column A.
You can change the value Apply to range to include the entire column as follow: A:A. For this condition doesn't matter, but there are situations where you want to apply the rule only for non empty rows, in such case you can change the above formula as follow:
=AND(LEN($A1)>0, ABS($A1) > $A$1)

Related

Conditional formatting using vlookup or Countifs

I am trying to use conditional formatting to see if an entry on A1-A10 is found on Sheet2!A1-A10. If it is then I want it to apply conditional formatting for every cell that it is found in on A1-A10. Every solution I have found so far is asking to use a < or > 0 which doesn't work.
This is what I've started with. I know this doesn't work but I am not sure where to go from here.
=VLOOKUP(Sheet2!A1:Sheet2!A10), $A$1:$A$10, 1, FALSE)
This works:
=NOT(ISERROR(VLOOKUP(A1;Sheet2!$A$1:$A$10;1;FALSE)))
When you add a formula for conditional formatting, you write it as if it concernes only the first cell of the range, i.e. A1 in this case, although the formatting rule is applied to A1:A10.

Excel conditional formating - conditional on sum of all previous cells and total sum

I have a question with regards to conditional formatting which I simply can't seem to solve.
The aim is to format the background color for the left-most cells that are blank up until a cell contains a value - and after this there should be no more formatting in this row. You can see an image of the result I'm hoping for beneath:
So far I've managed to create the conditional formatting of the blank rows, but sadly haven't managed to create the "single-cell" formatting (in yellow) conditional of the sum of all the first cells being = 0.
I've created a formula which actually succeeds in calculating the sum of the previous cells, but this formula includes INDIRECT() which it seems that conditional formatting doesn't allow. At least I'm getting an error starting with the follow (translating the error from Danish to English might not be intuitive):
You cannot use reference operators such as.....
The formula I'm trying is the following:
=AND(SUM(A2:INDIRECT(IF(COLUMN(A2)>=27;CHAR((64-26)+COLUMN(A2))&CHAR((64-26)+COLUMN(A2))&ROW(A2);CHAR((64)+COLUMN(A2))&ROW(A2))))>0;$K2>0)
Where $K2 is the sum of the row.
Is there a way to SUM a range of cells by doing something similar to this:
=SUM(B2:CHAR((64)+COLUMN())&ROW();"")) to dynamically SUM the range from B2 to the current cell? The problem in this case is whether the part CHAR((64)+COLUMN())&ROW();"") can be converted into a legible cell such as B4 to make it work inside the =SUM() formula?
Sadly the =ADDRESS() formula cannot be used (as far as I know) as this will trigger the same error in conditional formatting as well.
For now I would like this to work with the regular Excel conditional formatting, but if anyone have a simple VBA this would also have interest - however, I would by far prefer the regular solution.
The question:
Is there a way to create a formula that doesn't trigger this error - maybe by refrasing the formula or doing something completely else?
It seems to me that this could be handled with a much simpler CFR formula like,
=and(not(sum($a2:a2)), $k2)
Am I missing something?

AND / INDIRECT Conditional Formatting

What I am trying to achieve is if a cell in column AB equals "Yes" and a cell in column AC is blank, then a certain range of cells will be formatted. Currently the rule is not formatting cells that it should. I am basing this code on another formatting rule I am using that works properly, but does not use AND().
=AND(INDIRECT("ab"&ROW())="Yes", INDIRECT("ac"&ROW())="")
I am sure this is an obvious syntax mistake, but I am still very new to Excel and can't figure out why this isn't working.
Try This:
=AND($AB1="YES",$AC1="")
Use the format painter to drag the formula around.
As Jeeped said, change the 1 in $AB1 and $AC1 to your first row.

Copying conditional formatting with VLOOKUP across columns

I am formatting cell D25 using the following conditional formatting formula:
=(VLOOKUP($C25;$C$6:$L$18;2)+D25)>32
When applying the formula to the adjacent column I get formula updates to
=(VLOOKUP($C25;$C$6:$L$18;**2**)+E25)>32
Using the Copy and Paste Format function works mostly i.e. references in the formula are updated as I would expect.
The only (essential) thing that doesn't update is the INDEX value in the VLOOKUP formula. I would expect this value to increase by 1 when copying the format to the next column - it doesn't.
Is there any way to go around this issue with VLOOKUP? Is there a better suited formula to achieve the same result?
Any help will be greatly appreciated!!
This value does not increase automatically, and it is good. This formula was designed to be used on Tables, so consistency is a point here.
For conditional formatting, you may want to use $ to lock some references. For example, let we have the simple sheet as below:
First, select the range in the CORRECT order. This is important. the first cell you select will be reference for offsets of the conditional formatting. For this example, let's do it like this:
Now, let's go for the conditional formatting itself! Conditional Formatting > New Rule... > Use a formula to determine which cells to format. And let's put this formula:
=if($A1<=2;TRUE;FALSE)
Click OK and...
There we go! We just formatted the lines in witch An is equal or less than 2! Please note that we only had to lock the COLUMN of the reference. So, logically, to format the columns we would have locked the ROW.
Hope it helps!
EDIT:
If you REALLY want to use VLOOKUP, which I DO NOT recommend, you can just use the formula:
=(VLOOKUP($C25;$C$6:D$18;COLUMNS($C$6:D$18))+E25)>32
To change the index dinamically.

Summing multiple ranges as a conditional statement in Excel

I am trying to avoid using VBA if that's at all possible and I most certainly think that it is!
I'm currently trying to sum up a range if a certain condition is met. My function works when the range is limited and small, but does not work when I encompass my actual desired range. Here is some snippets of code:
=SUMIF(B13:M13,P23, B15:M15)
That function currently sums from B15 to M15 if there are any matches in between B13 and M13 with P23. It works like a charm. If there are discrepancies in between B13 and M13 it will only sum that matches which is exactly what I want it to do.
I want it to cover a much broader range, so I altered my formula as follows:
=SUMIF(B13:M13:B32:M32:B51:M51,P23, B15:M15:B34:M34:B53:M53)
I want it to do the same thing as before. I want it to analyze B13:M13 as well as B32:M32 as well as B51:M51 and compare it to P23. If there are matches I want it to sum B15:M15 as well as B34:M34 as well as B53:M53. If there are non matches, I want them to be omitted as was the case in my previous function.
Can anyone tell me what's wrong with my formula?
Actually, your formula =SUMIF(B13:M13:B32:M32:B51:M51,P23, B15:M15:B34:M34:B53:M53) converts to =SUMIF(B13:M51,P23, B15:M53) (you can check it for example using "Evaluate formula" tool in the "Formulas" Ribbon or by entering in cell B18 value, euqals to P23, and another value in B20 - your formula will add value from B20 to the result). And it doesen't calculate propertly, because you have some text values in B16:M33, B35:M52
So, you can use following formula instead:
=SUMPRODUCT((B13:M13=P23)*(B15:M15)+(B32:M32=P23)*(B34:M34)+(B51:M51=P23)*(B53:M53))
Here is result of evaluating your formula (=SUMIF(B13:M13:B32:M32:B51:M51,P23, B15:M15:B34:M34:B53:M53)):

Resources