Highlighting rows based upon two adjacent cells being different but specific numbers - excel

I am trying to put together a conditional formula for an Excel spreadsheet. What I need is for the row to highlight when cells A2 and B2 are two different, but specific numbers. For example, I want the second row highlighted when the value in A2 is exactly 12345 and when the adjacent value in B2 is exactly 67890. I do not want the row highlighted if the value in A2 is anything other than 12345 and the value in B2 is anything other than 67890. There are about 3,500 rows of numbers, so I am trying to speed up the process. I will eventually have to do the opposite, and see when the value in A2 is 67890 and when the value in B2 is 12345.
In order to clear up any questions, I am looking at an Excel document tracking phone calls made over a long period of time, and I want to highlight the whole row when two different phone numbers are calling each other among all the other phone calls.

With conditional formatting, you can use formulas. Highlight a row (let's say row 2 to start), and in Conditional Formatting, under "Use a formula...", =and($b2<>$a2,$a2=12345,$b2=67890).
If you apply that to your whole range (a2:b100, let's say), if the cell in A and B are different, and then only if A and B are the numbers you want, will the row be highlighted.
edit: added absolute cell references. Also, see #Grade'Eh'Bacon's comment.

Related

Search for duplicate cells within n + and - range of that cell

Hello everyone and thank you for your time.
I have a large table (A:2 to F:270) that we use to communicate the production schedule for the week. I would like to highlight duplicate lot numbers in column A and then highlight the whole row. Problem is, I only want it to compare within a certain range of each cell in column A (I don't want to compare it to the whole table).
For example, I would like the lot number in cell A11 looking for duplicates between A1:A21, and the lot number in cell A12 to look for duplicates between A2:A22 and cell A13 to look for duplicates between A3:A23. I can use conditional formatting of VBA whichever is easier
I have tried conditional formatting but it looks for duplicates throughout the entire table and highlights ALL duplicate lots numbers
You could create an extra column that returns TRUE when the lot number in that row is a duplicate of the range around it using:
=COUNTIF(A1:A21,A11)>1 for cell B11 in my example. It looks at the value in A11 and if it appears more than once in the neighbouring range, it returns TRUE. As you drag this formula down, the range will change e.g. cell B13 will be =COUNTIF(A3:A23,A13)>1.
You can then set up a conditional formatting rule to highlight the row when it equals TRUE.

How to Apply Conditional Format to show a field is mandatory to be filled in based on a vlookup to another sheet

I'm trying to create a form in excel for my team to fill out which highlights certain cells in a row as compulsory (format the cell colour) based on the number from a table in another sheet which has 3 preset dimensions ("M"=Mandatory, "P"=Prohibited, "O"=Optional) for each number across multiple analysis field.
I have tried conditional formatting formulas to highlight the cell to fill out if the lookup of the number chosen returns "M") but I don't seem to have a formula which validated this and returns with the cell highlighted when it needs to completed.
I would like the formula to return the cell as highlighted if it is mandatory based on the lookup to the table and need the user to fill out the cell with the information relevant.
Any help would be much appreciated.
If I understand your question correctly you just want the cell to highlight when its sister cell in another sheet is coded "M". That's a fairly easy formula.
=Sheet2!$B1="M"
This is for a straight column in B, where the cell it's checking against is in sheet 2 and also in column B. If it's for a row simply move the $ to say b$1.
If you want the highlight to disappear when the cell is filled in use this formula:
=AND($B1=0,Sheet2!$B1="M")

LibreOffice highlight cells if they are the same as a specific range

Master and Step Chart
Hello, I'm using A4-E4 as a "Master" code, and incrementally using A5-A8 to replace A4, B5-B8 to replace B4, etc etc first replacing one number of the "master", then two different numbers, etc until I have basically every combination. At some point the same number as the "master" is going to be generated. I have the numbers separated into groups of 16 on individually sheets for a total of 64 sheets. Obviously at some point the same number "43254" is going to generate on one of the sheets. Is there a way to search/highlight that number automatically upon generation? I've found that I can do conditional formatting to search for a specific cell, but not a range of cells. Like compare "A4-E4" to every set of five adjacent numbers in all the sheets, then highlight it. I have no idea if this is possible, but I'd appreciate it.
Select cells A4 through E4 and go to Format -> Conditional Formatting -> Manage. Apply style Good if Formula is:
CONCATENATE($A4;$B4;$C4;$D4;$E4)="43254"
So 43254 matches.
And 43253 does not match.
This is more complex than first appears. The following explanation may be difficult to understand if you do not have much experience with conditional formatting.
The formula gets evaluated 5 times, once for each of the cells.
Normally, rather than always indicating cell A4, Calc would interpret A4 as the currently evaluated cell (because we selected cells starting from A4). And B4 would indicate the cell to the right of the current cell that is evaulated. So for example, if such a conditional formatting formula were filled to cell D7, then A4 would actually indicate cell D7, and B4 would indicate cell E7.
However, our formula uses $A4 instead. The $ tells Calc that we always want column A even if the formatting is for column B or C et cetera.
One outcome of this is that the formula can be filled down or up but not left or right. If it is filled down one row for example, $A4 refers to column A but the current row, which would be cell A5.

Auto +6 increment while dragging cells in excel

So, I got an excel with two sheets: Sheet1 and Sheet2, in which I transfer data from the first to the second using the formula: =IF(INT(+INDIRECT("Sheet1!A1"))< 42900,0,+INDIRECT("Sheet2!A1")) (the cells are custom format dd/mm/yyyy hh/mm/ss). In Sheet1, the cells are organized in groups made out of 6 columns (in this example, A being the first column within the group).
In Sheet2, when I drag the cell containing said formula to the cell on the right, the formula remains the same. I want so that when I drag the cell, A1 will become G1, basically incrementing the column "number" by 6 jumping to the next group of 6 columns.
Is there a way of doing this WITHOUT using any coding. I need to avoid coding at all costs in order to avoid further complications.
P.S. I apologize if my explanation and title are somewhat vague.
Enter below formula anywhere in Column 1 and drag/copy across (to right)
=IF(INT(INDIRECT("Sheet1!" & ADDRESS(1,FLOOR((COLUMN()-1)*6,1)+1)))< 42900,0,INDIRECT("Sheet1!" & ADDRESS(1,FLOOR((COLUMN()-1)*6,1)+1)))
This formula will refer to cells $A$1,$G$1,$M$1,$S$1,.....
If you have to use this formula in say Column B then change (COLUMN()-1) to (COLUMN()-2) and likewise for Column C,D,E,.... use (COLUMN()-3),(COLUMN()-4),(COLUMN()-5),.... respectively.

Conditional formatting: automatically refer to the next cell?

I have a schedule with team member names and the column headers are half hour time intervals. I want to shade the cells of hours each person does not work with gray according to their shift schedule, so that I know not to schedule that person during that hour.
I have created a separate table with each person's shift schedule, and the names appear in the same order as in the schedule.
Is there any way to conditionally format the cells at once? There has to be an easier way then what I am doing now...which is one by one clicking on each person's cell and creating the formatting formula.
I can't copy paste the formatting because the formula still refers to the previous person's shift on the other table. I need it to refer to the next row.
The formula I use for conditional formatting is:
='Job Functions'!$O$5>$C$9
Where Job Functions is the sheet that contains the shifts, O5 is the shift assigned to that employee, and C9 is the column header on the schedule (6:30am). I just clicked on the cell and created a new conditional formatting rule from the excel ribbon on top...no vba.
If there is a VBAsolution to this that'd be great! I'm fairly new to VBA
Conditional formatting works like this
Let's say I have an array of numbers in A2:E5 and a header row in A1:E1. I want to have my array of number be green if the value of the cell is greater than it's column header. That is to say I want to compare A2>A1, B5>B1, D4>D1, etc. this means I want the header row comparison to be constant.
In Excel formulas you use the $ symbol to maintain constant references. Since I want the row to stay constant but I want the column to be relative to the cell in my array of numbers my header reference will be A$1 (column is relative, row is locked).
This is just the formula used to determine if formatting will be applied or not. If it returns true then the conditional formatting is applied, if it returns false then nothing happens.
However, where the formatting is applied is determined by the Applies to reference. In my example below I am applying the formula A$1<A2 to $A$2:$E$5. This means that in the cell A2 the formula A$1<A2 is used to determine if formatting is applied, but in B3 the formula B$1<B3 is applied. This is the same logic as if you were to have dragged the formula itself into these cells.
If instead my Applies to formula were $B$2:$E$5 this means that B2 would be colored green if A$1<A2, and B3 would be colored green if A$1<A3.
So with all that your formula should probably be
='Job Functions'!O5>C$9
drag and drop it down to fill the other cells

Resources