Conditional formatting to highlight lowest value amongst 4 cells?

Jyggalag

Active Member
Joined
Mar 8, 2021
Messages
445
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi all,

I currently have this setup:

1665129308010.png


My formulas in columns J-M look at their respective counterparts in columns D-G and once all four numbers have been entered in columns D, E, F and G, the cells in columns J-M will highlight which one has the lowest value. However, I would like to highlight this further and have some conditional formatting that also highlights the cell that returns the value for whichever cell has the lowest value. So in the first case column G contains the lowest value (first row of my IF(AND) formula) and I would like for this cell containing "KOLONNE G" to be highlighted with a red color.

My issue is that I am terribly bad at conditional formatting and I have no idea how to do this. Can somebody please help me? Would be greatly appreciated!

Thank you all :-)

Kind regards,
Jyggalag
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
However, I would like to highlight this further and have some conditional formatting that also highlights the cell that returns the value for whichever cell has the lowest value. So in the first case column G contains the lowest value (first row of my IF(AND) formula) and I would like for this cell containing "KOLONNE G" to be highlighted with a red color.
From Cell J4 to M10 use the formula below to conditional format and update

Excel Formula:
=J4<>""

Conditional Formatting -> New Rule... -> Classic -> Use a formula to determine which cell to format

Copy paste above formula with equal sign in formula bar
 
Last edited:
Upvote 0
Don't know if it's important for you, to have all the formulas in Column J:M, otherwise you could simplify it, by below formula:

1665131407262.png


/Skovgaard
 
Upvote 0
Just modify the formula I gave -

Excel Formula:
=J1<>""

And apply it to column J:M

Try it.
This is amazing, thank you so much Sanjay! Apologies for my late response.

Out of curiosity, is there a conditional formatting that can look at a row (so for example row 4) and highlight the lowest value within these 4 cells from column D-G, row 4? So that would be 0,25 in cell G4 in my case

If this is not possible, then thank you nonetheless!
 
Upvote 0
Like this?
Select D4:G?? and apply the CF formula shown

22 10 10.xlsm
DEFG
1
2
3
40.260.590.320.04
50.010.170.90.04
60.190.480.440.44
70.990.750.50.37
80.360.350.080.29
90.860.080.130.29
10
11
CF Lowest in row
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D4:G11Expression=AND(D4=MIN($D4:$G4),D4<>"")textNO
 
Upvote 0
Like this?
Select D4:G?? and apply the CF formula shown

22 10 10.xlsm
DEFG
1
2
3
40.260.590.320.04
50.010.170.90.04
60.190.480.440.44
70.990.750.50.37
80.360.350.080.29
90.860.080.130.29
10
11
CF Lowest in row
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D4:G11Expression=AND(D4=MIN($D4:$G4),D4<>"")textNO
It worked!
1665494923190.png


Thank you so much @Peter_SSs, absolutely amazing!

Appreciate all the help all of you! :)
 
Upvote 0
Also final question, and this is truly a matter of luxury, so if it's too complex and you cannot assist, i'm more than satisfied.

However, right now if I enter four numbers, then remove one, I will be left with this:

1665495072787.png


Hence showing that my response in cell D11 (the blank cell in the bottom left) is the lowest value.

Is there a way in which I can force my formula to ignore blank cells when it makes this calculation? Or simply set blank cells at a value higher than the other cells?

This is the formula I use for the "Lowest value" cell columns (example taken from cell J4):

=IF(AND(D4<E4;D4<F4;D4<G4);"KOLONNE D";"")

Do let me know if anybody has the solution to this :-) Thanks!
 
Upvote 0
Try this set-up. It also allows for multiple equal minimum values in a row (see row 5) and no numbers at all in a row (rows 9 & 11)

Note though that this will return incorrect results if columns are added/deleted to the left of the data. If that is a possibility that you wanted to allow for, some different (longer) formulas would be required.

22 10 10.xlsm
DEFGHIJKLM
1
2
3
40.260.590.320.04   KOLONNE G
50.010.170.010.04KOLONNE D KOLONNE F 
60.190.480.440.44KOLONNE D   
70.990.750.50.37   KOLONNE G
80.360.350.080.29  KOLONNE F 
9    
100.080.130.29 KOLONNE E  
11    
CF Lowest in row
Cell Formulas
RangeFormula
J4:M11J4=IF(AND(D4<>"",D4=MIN($D4:$G4)),"KOLONNE "&MID("DEFG",COLUMNS($J:J),1),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J4:M11Expression=J4<>""textNO
D4:G11Expression=AND(D4=MIN($D4:$G4),D4<>"")textNO
 
Upvote 0
Solution
Try this set-up. It also allows for multiple equal minimum values in a row (see row 5) and no numbers at all in a row (rows 9 & 11)

Note though that this will return incorrect results if columns are added/deleted to the left of the data. If that is a possibility that you wanted to allow for, some different (longer) formulas would be required.

22 10 10.xlsm
DEFGHIJKLM
1
2
3
40.260.590.320.04   KOLONNE G
50.010.170.010.04KOLONNE D KOLONNE F 
60.190.480.440.44KOLONNE D   
70.990.750.50.37   KOLONNE G
80.360.350.080.29  KOLONNE F 
9    
100.080.130.29 KOLONNE E  
11    
CF Lowest in row
Cell Formulas
RangeFormula
J4:M11J4=IF(AND(D4<>"",D4=MIN($D4:$G4)),"KOLONNE "&MID("DEFG",COLUMNS($J:J),1),"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
J4:M11Expression=J4<>""textNO
D4:G11Expression=AND(D4=MIN($D4:$G4),D4<>"")textNO
This is perfect Peter! Thank you so much !! :-)
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,182
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top