Conditional Format Based on User Input - excel

I am trying to use conditional formatting but I am running in to issues.
I have a single range which is populated based on user selection for an ActiveX ComboBox. What I am trying to do is highlight rows if the single range of cells contains duplicate values, but if the cell is blank, contains the word "Value", or does not match another cell in the range then leave the cell and row as is.
Basically if Cell B4 equals B46 then highlight both rows.
I have tried the following formulas with no success.
=IF(AND($B$4:$B$50="",$B$4:$B$50="Value"),0,COUNTIF($B$4:$B$50,$B$4:$B$50,0))
=IF(AND($B$4:$B$50="",$B$4:$B$50="Value"),0,MATCH($B$4:$B$50:$B$4:$B$50,0))
=IF(AND($B$4:$B$50="",$B$4:$B$50="Value"),0,IF($B$4:$B$50=$B$4:$B$50,1,0))
I'm still learning excel and could use some help on this. Thanks in advance!
Eric

I suspect what you want is a CF formula rule something like:
=AND(NOT(OR(B4="",B4="Value")),COUNTIF(B$4:B$50,B4)>1)
applied to B4:B50.

Thank you everyone who provided a response. I was able to develop a solution that worked based on your responses. The following is the solution I used:
1.) Created a conditional format highlighting duplicate values.
2.) Created a conditional format using the below formula to highlight duplicate rows, ignore blank rows, and ignore rows with "Value" in cell B4:
=AND(COUNTIF($B$4:$B$63,$B4)>1,LEN($B4)>0,LEN($B4)-4>0)
Thank you once again for everyone's assistance.
Eric

Related

change cell color with conditional format

I wanna ask about Ms. excel. maybe it will look so basic for someone who always work with excel. so thank you for anyone who help me with this.
I have sheet1 and sheet2. so i want to make cell in column A sheet 1, which have same data exist in column A sheet2 to change color automatically.
I don't know how to make it work so I made column helper in column c sheet1 with this formula
=NOT(ISERROR(MATCH(a2;sheet2!$A$2:$A$1000;)))
and get true if the data exist in sheet2. and then I drag that formula so all column c have this formula.
I thinking using conditional formatting, so I block column A in sheet 1, and make conditional formatting with formula
=C:C= "TRUE"
but this not work. i really a newbie and only study by myself from internet, but i dunno how to search to solve this problem.
any help or advice for this problem?
thank you so much before
You can put the formula that returns TRUE or FALSE directly into the conditional formatting rule.
You should define it on cell A2 first, then change the 'Applies to' range to be all the rows you want to test. If you can, I recommend you try to avoid using references like C:C.
So, supposing you want to test the data in cells A2:A10 on sheet1, then your rule would look something like this:
Note that my locale uses comma as parameter separator and not semi-colon, so you should adjust accordingly.
Try the following formula in CF rule.
=COUNTIF(Sheet2!$A:$A,"*"&$A1&"*")>0

How to highlight cells with duplicate values using Excel's inbuilt Conditional Formatting rules, specifically to compare < or >?

OS: Windows 10 Pro Version 20H2 (OS Build: 19042.1165)
Application: Microsoft Excel for Microsoft 365 Version 2107 (Build 14228.20250)
***Please bear with me for posting a non-code-related question. I posted this question on SU and I sincerely appreciate the members who gave their answers but I just couldn't get a satisfactory answer there. If moderators decided to close this post, you may follow this link to my post at SU.
When using Excel's inbuilt Conditional Formatting rules to highlight cells with duplicate values, specifically to compare < or >, it doesn't seem to work on my end.
I tried searching the internet about this issue to no avail.
Using the table below to visualize an Excel spreadsheet,
Value
Value
<
<
>
>
I highlighted cells A1:B3, clicked on Home Tab>Conditional Formatting>Highlight Cells Rules>Duplicate Values…,>OK. Regardless if I choose Duplicate or Unique on the dropdown options, it just won't work here. Only the first row is being formatted.
It works fine though when using conditional formatting formula.
I'd like to know, with your help, if this issue is isolated, or am I just missing something here? Could it be a bug?
Thank you all very much..
One way to highlight duplicate rows in a multi-column array, change the rule type to "Use a formula to determine which cells to format" and enter this formula:
=$A1=$B1
$ tells the formula to always reference columns "A" and "B"
Because there is no $ before the row number, it becomes dynamic and the condition is applied to each row in the array it applies to.
The conditional Formatting is performing as it is designed to function.
The reason selecting the duplicate conditional formatting option does not highlight rows where the columns match is because it is not looking at each row in the array separately, it is looking at the entire data set to see if there are duplicated values. So if you have a value in more then one cell (any row or column), it will highlight all cells with multiple values.
A B
1 a b A1 will be highlighted
2 c a A2 and B2 will be highlighted
3 d c B3 will be highlighted

Excel - condtional formatting based on multiple strings

I would like to fill the cells individually from C to L based on the 7 lists on the right. Unfortunately this isn't working too well.
Not every cell is getting filled and others are filled wrong/double.
I select the cells for the conditional formatting for the deep red list based on this:
=OR(ISNUMBER(SEARCH($M$2:$M$20; C2)))
I'd guess that here's a simple error in thought with the "C2"?. Thanks in advance!
Edit:
Link to the file
https://drive.google.com/open?id=1mtGdSlDCMdR1qXVU07Z-hGFyvtq21Hpb
The conditional format rule you are using applies to the range $C:$L. The first cell in this range is C1; substitute C2 in your formula with C1 and it should work as desired.

Excel Dynamic Conditional formatting

I am sure this is really simple but cannot get it to work. I am trying to do some conditional formatting on a sheet that over time will have additional columns added to it. I want the formatting to be there before hand since the data is being added via VBA and the person using the spreadsheet are not Excel experts.
What I have is a column with numbers in. When a new column is entered I want to compare the value with the value in the previous column and then colour the cell accordingly. I can do this for a single cell with for example "=D2>C2".
I want to be able to write the rules in cell D2 comparing it with cell C2 and then have the rules apply across the area D2:DDD300. So for example cell N19 will compare itself to cell M19.
I thought I could use the "Applies to" box but that does not work. Any ideas on how I can achieve this?
Okay this now appears to be working. Not sure what I did differently but deleted all the rules and then set them up again. The only thing I did different was to initially do it for just the 1 cell, then expanded it out to the row when I knew it was working, then finally the whole area.
Sorry to have wasted peoples time
Your method should work. It does for me. Maybe this helps:

Conditional Formatting to reflect Countifs

I am using Excel2010 and I have the following Countifs statement, which works.
=COUNTIFS(Apr2014Fixed!$T:$T,"1",Apr2014Fixed!$Q:$Q,"*No*",Apr2014Fixed!$R:$R,"*Yes*")
I want to see which rows in my spreadsheet were counted, so that I can determine whether I've done everything right. I tried conditional formatting with the following formula, but I know I'm not using it properly.
=AND(COUNTIFS(Apr2014Fixed!$T:$T,"1",Apr2014Fixed!$Q:$Q,"*No*",Apr2014Fixed!$R:$R,"*Yes*")=3)
I don't understand what value I am looking to highlight. I thought =3 because I want all three conditions to be true for a case to be counted, but this didn't highlight anything. When I tried >3, it highlighted the entire spreadsheet.
Obviously, I have no idea how this works? Can anyone help, please?
To format rows across multiple columns, select the desired columns (in the screenshot I selected Q to T) and create a new conditional format with the formula
=AND($T1=1,ISNUMBER(FIND("No",$Q1)),ISNUMBER(FIND("Yes",$R1)))

Resources