Excel condtional formatting - multipile conditions and search references - excel

I would be very grateful for help with this conditional formatting problem as I'm terrible with excel but learning.
I have a large data set which I want to count specific OPCS codes (Classification of Interventions and Procedures). The issue is, that in some rows there are multiple OPCS codes that I am searching for and I need to find these rows and then manually decide which is most appropriate so figured highlighting the offending rows would be best.
I previously did this manually by using a simple conditional formatting formula to highlight all the OPCS codes I was interested in, then just scrolled down and made changes. However now I have ~8000 rows which makes this prone to error.
Is it possible for a conditional formatting formula to highlight rows which contains multiple OPCS codes that I am searching for? For reference columns I-U contain the OPCS codes and my lookup OPCS codes I am searching for are in a separate table.
It may be that conditional formatting can't be used for this so alternatives solutions would be much appreciated.
Many thanks!
Spreadsheet image example

I would say this is too complicated to do with a single formula. However, if you are willing to additional 13 columns to your table, can you get the info you need. Let's say you put the first formula in AI2 and fill it across to AU2 and then down to all rows:
=IF(ISERROR(MATCH(I2,$H2:H2,0)),IFERROR(MATCH(I2,TableOfInterestedCodes[OPCS Code Field Name],0),""),"")
This will display only the unique values of any OPCS codes that you are interested in. Now you can apply the conditional formatting formula as follows:
=COUNT($AI2:$AU2)>1

Select the area to be formatted and use the formula shown below (suitably adjusted to your actual layout)

Related

Conditional Formatting in Excel 2016 minus blank cells

I'm trying to get a column to highlight cells with duplicate values, but NOT the blank cells. I have seen a lot of information for older Excel programs, but I'm working specifically with Excel 2016.
I have tried =COUNTIF, but I just can't seem to get it to work without error. I know how to get Excel 2016 to highlight duplicates, just not while also excluding blank cells.
Thanks in advance for any help or suggestions you have!
There is a really simple solution to this that doesn't involve formulas. Create two conditional formatting rules over the specific range, in the following order:
Cell Contains a blank value -> no formatting -> stop if true
Duplicate value -> custom formatting

Excel: Select column starting from cell X in formatting rule

I'm trying to create a rule that formats a row so that it has red background color if the content of another row is "x". Unfortunately, the header and empty cells above the table will be included if I simply select =$H:$H="x" as my condition for formatting. I want something like: =$H$6:$H$(INFINITY). Is this possible?
If you want to apply the conditional formatting starting from Row6, while selecting the range for applying the conditional formatting, make sure C6 should be the first cell in the selection i.e. it should be the active cell in the selection and then make a new rule for conditional formatting using the formula given below.
=$H6="x"
Also if you are not sure how far you need to apply this conditional formatting down the rows, would be better if you format your data as an Excel Table, so when the data grows withing the table down the rows, the conditional formatting will also be carried to the new rows added in the table.
Having a conditional formatting for a unused range on the sheet increases the file size as all the rows contain the conditional formatting and the formula in the background.
You can just use =$H$6:$H$1048576 or =$H$6:$H$65536 while applying conditional formatting. A simplest way of doing this.
Your formula does lag a lot as you are searching through so many rows down. THe best thing you can do is try to limit the amount of rows to search. I.e. if you know your dataset only contains max 5000 rows, set the limit to that H6:H5000. This will help.
If the rows change a lot, the best way would be to make it dynamic. I.e. make a name range for the range you want to validate and in the name manager, change the range to include offset. This will help you set the range to be what you have data in. Note: You need to know how many rows (i.e. use counta) which you will need to figure out if there are blanks at any point. Otherwise you do the counta on a column where you have no blanks.
Hope this makes sense and easy for you.

Using conditional formatting to compare multiple cells in one row to another

I'm trying to figure out what formula I can use to highlight duplicates in a spreadsheet.
I want to compare data across multiple cells to see if it matches with other sets of cells with the same data.
For example, given this data:
Name, Food, Animal
Donald, Hamburger, Alligator
Rupert, Sushi, Alligator
Christie, Hamburger, Panda
Donald, Hamburger, Alligator
I want to make excel highlight the 1st and 4th cells as all values are the same across all three cells. I've tried countif to create rules to highlight the duplicate cells but I cannot seem to get excel to compare across three cells. Is the only solution to use IF AND to compare each column one by one? The data set is several hundred rows long so I am trying to figure out a quick way I can repeat this check across multiple workbooks. I've tried to use the basic conditional formatting options provided by excel but haven't been able to get a good result using those.
Thank you!
If Name is in A1, please try a Conditional Formatting formula rule of:
=AND(COUNTIF($A$1:$A$100,$A1)>1,COUNTIF($B$1:$B$100,$B1)>1,COUNTIF($C$1:$C$100,$C1)>1)
with Applies to: =$A:$C.

Excel: How to do conditional formatting based on two cell values?

This particular question is regarding highlighting dates on a pre-made calendar.
Please see screenshot below:
I need to highlight the cell in the calendar that matches both the task and the date in the data table. For example- see L3 and P4. In the screenshot they are highlighted manually for demonstration.
Can someone please help me out with this. I've been using AND, but screwing up somewhere with the $.
If you aren't entering any data and using this as a visual tool you can spoof the spreadsheet by placing a period into the cell that matches the values you need, and then conditional format based on specific text and enter the period as the text.
This image demonstrates it as two separate tables; One with only the formula used to look for the values, and the second one formatting the background and font to be the same color (effectively hiding the period)
It its definitely a workaround and will only work if this is a visual tool.
Assuming your Data Table goes down to row 7, try entering this Conditional Formatting formula with cell B3 selected:
=COUNTIFS($AI$4:$AI$7,$B3,$AJ$4:$AJ$7,C$2)>0

Excel conditional formatting of adjacent cells from a drop down list

I've been searching around here but I can't find anything quite like what I'm after.
In excel I have one column with a drop down list of a dozen different initials, with conditional formatting on those cells. I would also like to format another column based on those initials, but don't want to set up a dozen rules on each cell, one by one. If I set up the top cell with the correct rules I cannot fill the formatting in because the formula is not updated on a row by row basis, but en bloc for the range.
I have no real experience with VBA or macro's, is there a way to do this more elegantly than brute force?
Thank you very much in advance. This forum has always been a great help, hopefully you can help this, too!
I hope I'm not misunderstanding your question. You can copy the formatting to the other columns if you have set up the format as a formula. For example, if A is your column with initials, and you have a data cell in B2, then you can set a formula in B2 as A2="ER", for example, with the formatting you want, and do the same for the rest of your matches on A2. Then, you can copy the format down column B (unfiltered) using Paste Special Format. You can copy the conditional formats across as long as you make sure that your format in the conditional formatting rule is anchored on column A (i.e., $A2="ER").

Resources