I'm trying to apply conditional formatting to my data where I need to color the rows based on certain columns. If the current and previous rows have same data in 4 particular columns, I will color those rows. But I also need to apply this color to alternate rows.
So the result I need is like the format in the image below:
As in the sample image above, first two rows have same values in column Name1, Name2, Type_Name and Type_Code, they are colored. Then, the next row is skipped from coloring. And then the next row even if it does not have a matching row above or below, it will be colored. Then rows with Rita in Name1 are skipped.
So far I'm able to get to the rows with same values in the 4 columns and color the alternate rows, both the logics separately, but unable to apply the mix of both properly. Below are the logics applied so far.
This one, where the rows have same values in the 4 required columns, using the formula
=OR($H2&$I2&$J2&$K2 = $H1&$I1&$J1&$K1, $H2&$I2&$J2&$K2 = $H3&$I3&$J3&$K3)
And alternate rows colored with the formula
=MOD(ROW( ),2)=0
I would first add a helper column which separates the groups.
This is done by checking if the relevant columns of the row is the same as the row above. If it is, we simply take the max value of the column, if it is different, we increment the max value by 1. We can then apply the conditional formatting if this helper column is an odd value:
Related
I need to group rows together with borders based on the value in the first column. These groups can vary between 1-10 rows. I'm hoping to create a formula that works in the following logic:
1 Select row
2 Check if next row has the same value in column A
3 If next row has the same value, also select next row (do this until the next row has a different value)
4 If next row has a different value, create a border out of the previously selected rows
5 Select next row and start over at step 2
The formula to test if the value in the second row is different to the value in the first row is
=A2<>A3
If you want to use this rule across a range, you need to use absolute reference for column A, hence
=$A2<>$A3
Presume you have a 4-Column table, and you want to use the above rule to highlight rows where the value in column A is different to the next value in column A, you need to set up three conditional formatting as shown below.
Please note Column E is for demonstration only and you do not need to create this helper column at all.
It would be a tedious work when you want to use conditional formatting across a range of data instead of a single column. In your case, you will need to set a format for the beginning column of the range, set another format for all columns in between, and set another format for the last column of the range.
Hope this answer your question. Cheers :)
I have two columns of values in excel I want to format.
If two Rows in Column A match, check column B to see if those two row's values match also. If they don't match, highlight the rows.
For example, the first columns first two rows values match so I want to check the second column to see if they match. They do not so both rows should be highlighted. The third and fourth match, and the second column for those rows also match, so these should not be highlighted.
Number Tool
227974 9285
227974 9219
229703 9219
229703 9219
Assuming your data is in the top left, select the data cells and create a conditional format with condition:
=OR(AND($A2=$A3,$B2<>$B3),AND($A1=$A2,$B1<>$B2))
And set it to highlight as you would like.
I have a table with times of actions and I want to highlight rows that are more than 20-ish minutes more than the one above.
The actual number of minutes is less important.
For that I use conditional formatting with the formula:
=F3-F2>0,01766
So far so good.
But now if I apply filter on the table the the formula does not work anymore because it looks at the hidden rows.
Only the first highlight is made by the conditional formatting the other two are done by me.
Is it possible to get conditional formatting to look at the visible rows only?
I was able to come up with a solution only by using a special columns for the filtered index. In my example, i am filtering the data by '1', So i will add '1' in Column L. If you have multiple filters, you can add in the next rows in col L.
Col H checks if cell in Col E exists in the filters list
Col I finds the last row that is not filtered. The formula has to be entered as an Array Formula i.e. enter the formula and press Ctrl Shift Enter
Col J checks if the difference between cells in Col F for the current row and the last not filtered row is between 20 and 21 minutes. Conditional formatting is applied for this cell being true
Below image without applying any filter
After adding '1' as filter
Filtered rows hidden
Formula
Here is a Google Sheet
Note that SUBTOTAL() has options for ignoring hidden rows: this gives you a way to create a formula-based helper column for determining whether or not a row is filtered out....
Note Col C is an Array formula
After filtering for "A" only:
This way you can filter on multiple columns if required.
I'm fairly new to Excel and so not very experienced, but I'm trying to get an entire row to highlight red based on 2 other cells, using conditional formatting. The requirements are for the corresponding M cell in the row to have the value 'N' and for the corresponding E cell to have a past date value '<*NOW'.
I've tried a formula based on an answer for multiple conditions:
=AND(M="(N)";E<*NOW)
A formula for formatting an entire row:
=INDIRECT("m"&ROW())="N",("e"&ROW())E<*NOW
And combining the two:
=AND=INDIRECT("m"&ROW())="N",=INDIRECT("e"&ROW())E<*NOW)
(ignore all the asterisks its the only way i could get the NOW to appear)
None of these are working, please help!
Assuming your data starts at row 2 then select all rows, e.g. 2 to 100 and then apply the condition for row 2, i.e. use this formula
=AND($M2="N",$E2<TODAY())
That will now apply to the whole range. The $ signs make it format the whole row
How to delete duplicate items in excelsheet(column), where it has to delete the items which has more than one occurrence:
1
2
3
3
4
4
If we use remove duplicate option, it will give distinct values, but what should be done to get only values
1
2
Since 1 and 2 values are not duplicated and these two have only one occurance in a Excel(column)
Follow Below Steps.
Consider you have data in column A
Write formula as =IF(COUNTIF(A:A,A1)=1,0,1) in column B.
Apply Step 3 for all rows that are there.
Wherever you have duplicate data, you will see 1 in column B else you will see value as 0. :)
Go To menu Data and apply filter for 1. Those are the rows that are duplicate. Want to delete it?? Delete it :)
Here is the demo
How about Conditional Formatting --> Highlight cell rules --> Duplicate values
Duplicate values now highlighted. Apply filter, sort by colour, delete all highlighted cells - that only leaves unique values.
The COUNTIF macro is pretty slow for long columns. If you need something faster, you can do the following:
Sort the column of values in column A.
In Column B next to it, add the formula =IF(A1=A2,0,1)
Double-click the + icon at the bottom right of the formula's selection box to apply the formula to the whole column.
Add a filter while both the columns are selected.
Click the column B filter arrow button to show only values where Column B = 1
This will flag all of the transitions from one value to the next with a 1. Then the filter will only show those rows with a transition. The resulting filtered column A will contain only the unique values.