Excel Conditional Formatting and Rounding Issues - excel

I am trying to find a way to use excel formatting to show the color red when a specific cell is not equal to another cell. However, there are times when the value is off by two or three numbers due to how excel rounds(ex: 593=594, 593=592).Is there a way to use excel formatting or any other way to make it so if the value of the cell is very close to the targeted cell, it will not result in the cell being formatted to red. Anyway this the simple formula I am working with along with example:
=I3<>F3
EX:
**I** **F**
593 594
Essentially the F cell will be highlighted in red but because the difference is negligible,
I don't want to highlight red. At most, I would like to have a difference of more than 3, where the cell won't highlight red.

You should consider the absolute difference between the two numbers. If it is in a given range, which is acceptable, you may consider them equal. Thus, this is the formula that you need:
=ABS(I3-F3)>0,5 '0.5 if you are using "." as a decimal separator
It will consider 233.4 and 233.6 as similar values. MSDN ABS
In general, if you write =ABS(I3-F3)>0,5 in Excel it should evaluate to TRUE or FALSE. If it does not, probably the comma is the problem, thus change the comma with a dot - ..

Related

how do I compare each row of two different columns and highlight the highest value (not formula) in each row?

I have two columns to compare. All cell values come from the ROUNDUP function. =ROUNDUP(C6/D12,0) etc.
I want the larger, or equal, of the two in each row to be green and the smaller red. Using the formula, it does not work as expected. If I do the same with numbers typed, not the formula, it works. It appears the formatting applies to the formula and not the value.
That is the first half of the problem. I also want to autofill/paint the conditional formatting to numerous cells, but it always compares to the top left cell, rather than the two cells on the same row.
If I use the color scales formatting it works, but I do not want the scales, just red/green.
It seems hard to believe that what I want to do is not possible. Can someone please help me with this. Thanks in advance.
In conditional formatting, under 'use a formula to determine which cells to format', you need to enter
=A2=MAX($A2,$B2)
to highlight the larger cell and (as a separate rule)
=A2=MIN($A2,$B2)
to highlight the smaller cell.
Note that in the case where both cells have the same value, they will both be either coloured red or green depending on the precedence of the rules. If the 'green' rule comes first,
it will look like this:
Conditional formatting is almost its own little science within Excel. It may be more useful to find youtube tutorials on the topic than depend on a text explanation here. But the central theme is this.
You will use location locking (the dollar sign or F4) in front of the letters so that any cell to which the format is applied knows you specifically mean columns E and F, for instance.
Example: Assume your first row goes from A5 to M5, and the condition values are in E5 and F5.
I find it easiest to format one row with the rules I want, test them, and then use the format painter or copy -> paste format along with careful use of $ locking.
Drag over and select the entire row of cells A5:M5
Conditional Formatting -> New Rule -> Use a formula to determine which cells to format
In the formula field enter =$E5>$F5. Excel gets weird and often inserts double quotes. If you save the rule and go back in, it may say ="$E5>$F5" and if so delete the double quotes.
Click Format and create the cell format you want.
With A5:M5 still selected, add another rule and format for ="$E5<$F5"
The $ sign works the same way as it does in a formula. All of the columns get their format based on columns E and F, but all of the rows base their formula on the E and F values in that same row.

How to find duplicates when value is not equal to text?

So... this is going to be a difficult explanation...
I am using a barcode scanner to enter a 20 digit number into Excel. Due to the limitations of Excel this has to be done as text, since Excel only allows up to 15 digits.
This means that my cell has a shown value of example 00257108402007839772 but the value "behind" the cell is 257108402007839000 (the last 3 digits are turned to zeros).
I have to check the values for duplicates, and the last digits are in most cases the digits that differentiate the numbers from each other. This means that when doing a conditional formatting on the cells, the most part of the numbers are flagged as duplicates.
So my question is basically - do you know of a way to search duplicates on the shown value, and not on the "real" value of the cell?
I hope this makes sense....
Here is something for you to consider:
As you can see COUNTIF() does not work on these values, but SUMPRODUCT() will when we just directly compare a range against a single cell. Below you'll see an example of conditional formatting:
Rule used on range A1:A4: =SUMPRODUCT(--($A$1:$A$4=$A1))>1

Apply Conditional Formatting to Range but Only Format Cell Where Condition Is True

I have a sheet that looks like this:
The coloured cells need to be a specific colour based on their value. I am currently using conditional formatting to achieve this, but I am only able to get it to apply to a single column instead of the entire range A:G. For example, here’s my formula for column A for values that should be coloured light blue:
=OR($A1="CA515",$A1="CA525")
And applies to:
=$A:$A
Using the above formula, if any of the cells in column A contain the value CA515 or CA525, the cell alone is coloured light blue. Is there any way to use a single conditional formatting formula to make it possible that if any of the cells in the range A:G contain the value CA515 or CA525 that only that cell alone is coloured light blue? Or do I have to apply the formula to every column individually, or possibly even resort to VBA?
Thank you in advance!
You can avoid using VBA here*... Remove the dollar signs in your conditional statement, it should be
=OR(A1="CA515", A1="CA525")
The dollar signs specify whether the reference is relative or absolute. To visualise how this works, try typing these formulas into a cell and dragging the corner of the cell down to autofill:
=A1 'Autofilling this down will give =A2, =A3, ...
=$A1 'Autofilling this down will give =$A1, =$A1, ...
So by removing $, your format condition should be spread across the range. To set the range, change "applies to" to $A:$G.
Note: many conditional formats over a large range like this could severely impact the speed of your document. Consider at least limiting the number of different formats, or the number of rows it's checking.
*Although the above method does avoid VBA, it might be quicker to write your own formatting routine in VBA, since it wouldn't have to get checked so frequently and it would be unaffected by moving around of ranges which messes with conditional formats.

Conditional formatting of cells that contain formulae but no values

I like to use conditional formatting to provide extra information in my spreadsheets, but I now find myself stuck.
In a spreadsheet of cargo items, I have a column (calculated; it contains a formula) for density. Previously, it just changed text colour, so empty cells didn't stand out. But now that I'm trying to really show up any anomalies with a bright background, I've found that it (or its sibling) highlights all the "empty" cells that don't have calculated values yet.
The formula I'm using is WHERE THE VALUE IS GREATER THAN 10 for the upper out-of-bounds area, and =AND($L2<3,NOT(ISBLANK($L2))) for the lower area. I've also tried using $L2>0 instead of the NOT clause.
The ideal would be changing the upper and lower density limits based on the material it's claimed to be in the description field (column B), but I'm not bothering with that until I get this working.
Is the formula I'm using right, or should I tweak it? Would I be better off just using GREATER THAN 0 and then formatting the right densities blue as =AND($L2<10, $L2>3)?
I think counter-intuitively it is the
WHERE THE VALUE IS GREATER THAN 10
formula that may be doing the damage.
You probably have a formula in column L on the lines of
IF (<cell in previous column is empty> , "" , <some calculation>)
and when the conditional formula compares the result to 10 it actually gives TRUE because a text string is considered to be greater than a number in this context.
I suggest trying two things:-
(1) Change the colour of the WHERE THE VALUE IS GREATER THAN 10 formatting rule to see if the 'empty' cells are highlighted in that colour.
(2) Instead of WHERE THE VALUE IS GREATER THAN 10, use a formula like
=AND(ISNUMBER(L2),L2>10)
this works for me.

Excel find equal cells

lets say I have a xls sheet with just one column which has the following content:
1
2
3
3
4
5
5
6
You see there are some cells with equal content.
Now I want Excel to format (e.g. background) all cells which are there twice.
I would say that conditional formatting is the right way but there I always have to enter a certain cell.
Is there any possibility to do this?
Best,
Elias
I do this routinely. Start at the second cell and select the rest. Choose Conditional Formatting, as you thought, select VALUE IS EQUAL TO, and click the cell above (let's call it A1). Here's the trick: it will enter this as an absolute reference - $A$1 - but you need to strip out the dollar signs, so it is relative. Now (of course) assign a background color, or whatever style you want, and the first cell in any sequence of identical values will have normal formatting, but subsequent cells will have the style you choose.
This isn't exactly what you've asked for - the first 3, for instance, will still have normal formatting - and I'm not sure I know a way to get all the duplicated cells, including the first, styled differently. But it's a start...
Select A1:A8 and enter this conditional format - Formula Is
=COUNTIF($A:$A,A1)>1
and set a format. It will format anything in column that appears more than 1 time.

Resources