Compare three excel columns to find the lowest number and highlight it - excel

I have three excel columns containing different prices. I would like to run through these columns and find the lowest price and highlight it with a different cell colour or change its text colour.
Example:
A1 -> 21,000
B1 -> 3,000
C1 -> 7,500
The cell to be highlighted would be B1.

Try this which seems to work:
=IF(A1<>"",IF(A1=MIN($A1:$C1),1,0),0)
Result:
To apply it on the entire column, change the Applies to field to:
=$A:$C
HTH.

You can use Conditional Formatting for this.
Set the condition as the 'Formula' option and use the condition
of =MIN(A1:C1)
Set the conditional format to the desired
highlighting settings.

You could also write a little VBA script to determine the smallest Valeue in any Range.
Here is a link to with the necessary information:
http://www.globaliconnect.com/excel/index.php?option=com_content&view=article&id=105:find-smallest-and-largest-value-in-range-with-vba-excel&catid=79&Itemid=475

Related

How to compare two different column and highlight highest value in each row?

I am aware of using MAX for conditional formatting however I am confused about how to compare two different columns. I would like to use conditional formatting to compare data/value from columns B and Columns E, then highlight the highest value in each row based on these two columns. I wonder if this is possible?
It does not seem working for this:
enter image description here
You can use conditional formatting to achieve this:
Select the entire range (for example, B1:E10)
Add a new conditional formatting rule.
Home >> Conditional Formatting >> New Rule >> Use a formula to determine which cells to format:
=($E1>$B1)
=($B1>$E1)
Just make sure you type the Formula rather than selecting the cell, or you will have the $ symbol in the reference, which you don't want in the row reference.
So highlight the largest value in each row? That is possible using conditional formatting.
For example, if your entire data frame is in A2:B11, first do =B2>A2 then =A2>B2.
The steps for conditional formatting are below:
highlight the full column of cells you wish to format (in this case, say A2:A11)
Home->Conditional Formatting->New Rule->"Use formula..."
Enter the above formula (being sure to unfreeze column and row references)
Format->Fill->Select Color->Okay->Okay

How to use marco to dynamically change color of row if there is same value in a cell

Could you please lead me in below task?
In excel sheet I want to make that if there is a same value in a column, I want to dynamically change the color of the row that includes the same value.
The important point is that, i want to change the color of the only row based on other column cell value.
Ex:
No | Patch number | Patch version
1 123456 6
2 123456 7
In above example, I only want to change the color of row of number 1. The condition is based on Patch version .
Thank you!
For this example I entered the desired patch number in another sheet and named the cell 'PatchHighlight'
Then used this formula for conditional highlighting on rows 2 to 100
=$C2=PatchHighlight
The PatchHighlight cell could itself contain a formula, such as =MAX(C:C)
Ok, I think this does what you want. It can highlight any row where another row has the same value in A and a larger number in B. The formula to use is:
=COUNTIFS($A:$A,"="&$A2,$B:$B,">"&$B2)>0
If you stick this formula in C2 it will display TRUE or FALSE depending on whether other rows have the same value in A and a larger number in B or not. Then you could copy it down to all the other cells in C.
If you want to highlight rows using this you need to highlight row 2 and choose Conditional Formatting, choose New Rule, choose "Use a formula to determine which cells to format" and enter this formula along with the desired formatting. Then you need to choose Conditional Formatting, choose Manage Rules and enter this formula into the Applies To field:
=OFFSET($A$1,0,0,COUNTA($A:$A),3)
This will make the conditional formatting apply to columns A, B and C of every row of data you have. And if you add more data it will automatically highlight those rows too.
For more detailed instructions have a look at https://www.get-digital-help.com/2009/05/17/prevent-duplicates-using-dynamic-conditional-formatting-in-excel/ but use these formulas instead of the ones they suggest for finding duplicates.

Excel Conditional Formatting - Highlight blank cells between

thanks in advance for the help.
I'm making a Gantt chart in Excel and am trying to integrate the capability to highlight the work week (WW). The idea is that one can select the WW from a drop down menu and the corresponding columns in the chart are highlighted. I am struggling with the conditional formatting formula to highlight the desired dates.
Here's a screen shot of how the chart is set up
I am able to highlight the column of the cell containing the WW value (e.g. in picture column I is highlighted as it contains "WW42" in cell I3. I would like to be able to highlight the days from Sunday to Saturday of each WW.
Most formulas (that I know) work on the value of the cells rather than their location or index. I have tried simply filling in all the blank cells with the WW value and then hiding the value, but the formatting isn't aesthetically pleasing and it's not efficient.
I have also tried merging the WW cells, but am unable to select all columns of the length of the merged cell, just the first column associated. For example, if I merged I3 to O3, conditional formatting will highlight that merged cell and only column I.
Any suggestions on how to approach this is greatly appreciated!
Attached is a screenshot of my structure with my conditional formating working as required. You'll need to adjust acording to your structure, but I used a formula-based conditional formating, with the rule:
=COUNTA($B$2:B$2)=$A$1 //Where A1 contains the workweek I want to highlight
Entered into cells $B$3:$V$6. Of course, in your case you'd have to change it to something like:
=COUNTA($B$2:B$2)+41-3=$A$1
Since your work weeks start at 42 and you have 3 extra headings you dont want added on your sum (ACTUAL START, ACTUAL DURATION and PERCENT COMPLETE). Also the header for the work week has to be a numeric value, but you can play around this to get what you need. Let me know if you'd need further help.
You do not need to use the third row for your conditional formatting, if row 4 has legal excel dates. The WEEKNUM() formula gives you exactly what you need.
If your Dropdown Menu is in cell B2 and consists of numbers from 1-52 then this should work for your conditional formatting:
=$B$2=WEEKNUM(D$1)
See attached photo.

Excel: How to highlight cells if the neighboring cell value differs by 2 or more?

I have several hundred rows of data in sets of two rows. Each row has ratings from 1-5. I need to highlight the cells when they differ by more than 1.
For example if one cell has a "4" and the cell below it is "3" or "5" that is ok. If one cell has a "4" but the cell below it has a "1,"2," or "5," both of those cells need to be highlighted.
I have looked into using conditional formating but this does not help because I can only enter rules asking to highlight < or >, not specific differences of 2 or more.
Background: The data is two sets of subjective ratings of videos of an autistic patient using psychological measures. If one rater differs from the other rater in scoring by more than "1," the data needs to be highlighted so the scoring for that measure can be discussed.
The picture is how the data should look like (not actual data file): http://imgur.com/a/Uym3G
Thank you!!
Assuming you only have two raters and no gaps in Column A after the first video and before the last, please select the range to be formatted starting in C4 and try this CF formula rule:
=OR(AND(ISODD(ROW()),ABS(C4-C3)>1),AND(ISEVEN(ROW()),ABS(C4-C5)>1))
For simplicity, and because I like to always have the ability to quickly change my conditional formatting, I like to use helper columns.
In this case, you can bring a helper column that you will hide afterwards.
Assuming your data starts in A2, and row 1 is your header rows. Assuming we are putting a helper column in B:
In B2 and B3: =ABS(A2-A3)
Drag all the way down
Put cursor in A1, conditional formatting based on a formula.
Formula =$B1>=2
Applies to $A:$A
Hide your helper column
Not sure what you base your statement about conditional formatting on, because what you describe is entirely possible with conditional formatting.
In conditional formatting you don't have to slavishly click the out of the box cell highlighting rules. You can easily roll your own by using a rule with a formula. Consider the following screenshot:
Select cells A2 to A10, create a new rule that uses a formula and enter this formula:
=OR(ABS(A1-A2)>1,ABS(A2-A3)>1)
Select a format and apply the rule to more rows/columns as desired.

highlight entire row using conditional format

I reviewed below answer. it's really working for me when i used david's answer. But i have slight different question.
I want to highlight A1,B1,C1,D1 and E1 when condition is true for A1. As per the below answer it highlighting only values in column A
Compare Two columns
Regards,
Ramana
Assuming you should highlight columns A:E in case A1 has "abc" value, you should do the following:
Select the desired range of cells (or perhaps entire columns A:E).
Add Conditional Formatting rule based on a formula, enter the following code: =IF($A1="abc",1,0)=1
Select desired highlight and apply rule.
You're done. The above code will highlight ANY row for A:E columns in case corresponding cell in A has "abc". Modify condition as you wish.
Sample file: https://www.dropbox.com/s/eyx2un2v5r5z25w/CondFormatA-E.xlsx
If you are using this formula for column A
=NOT(ISNA(VLOOKUP(A1,$B:$B,1,FALSE)))
then just amend it by putting $ in front of A1, i.e.
=NOT(ISNA(VLOOKUP($A1,$B:$B,1,FALSE)))
and apply that conditional format to all 5 columns A to E
Note: it might be simpler to use MATCH - this should give the same result
=MATCH($A1,$B:$B,0)

Resources