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.
Related
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")
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.
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
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.
So I've got a cell that I'd like to colour orange if the date in that cell (lets say that cell is C1) is later than a date in a cell (lets say B1) somewhere on that same row. I can conditional format C1 to do this. All good. But then I'd like to create an indeterminate amount of rows like this. The two dates which I want to compare are in the same column in every row, but are compared per row. So one date in C1 will compare to B1. Another in C2 will compare to B2. There doesn't seem to be a conditional formatting technique to achieve this. Help?
P.s: A few things I've tried is using If statements but I can't seem to work out how to do it. I've also tried conditionally formatting one row and then using "insert" to replicate the condition formatting of the row above it but this seems to start comparing the inserted row to the date in the row above...
In order to apply conditional formatting to a range you can select the range first (and then that range will automatically become the "applies to" range in conditional formatting)
....then set the formula that applies to the first row of that range only
....then select appropriate formatting
As long as the formula uses the correct relative references that's sufficient to make it work for the entire range
So in your specific case you can select the whole column, or a specific range like C1:C100 and then apply the formula that you need for the first row of that range, i.e.
=C1>B1
Another way to achieve this is to apply the formula to the first row only (as you have done already) then click on "format painter" (the little brush on the Home ribbon)......then select the range to copy to (e.g. C2:C100)