Notifications
Q&A

Highlight the maximum value per row across multiple columns

+2
−0

An as yet unanswered OpenOffice Calc - Highlighting the higest value in multiple columns posted by Rui on Super User from early this year asked whether a condition was possible to:

fill with a color in the highest value between multiple columns

The context was OpenOffice Calc and a data sample was provided. A simplified version, with headers, of the sample data is:

Sample data and layout

|Q1|Q2|Q3|Q4|Total
A|77|23||11|111
B|4|5|6||15
C|-3|25|8|14|44
D|1|1|2|2|6

shown after highlighting has been applied to the relevant cells. It was stated: "The value should be filled not in TOTAL but in the columns that have all the other values."

Why should this post be closed?

1 comment

I have edited this post and a few others to better emphasize the references to the SE sites (Stack Overflow or Power User). Please try to use similar references (the source name and the author are the most important elements) for future posts. Thanks for your contributions. ‭Alexei‭ 11 days ago

1 answer

+0
−0

Yes, it is possible (OpenOffice Calc 4.1.4).

Select from ColumnE to ColumnB () and Format > Conditional Formatting…, in the dropdown for Condition 1 change Cell value is to Formula is and enter:

AND(B1=MAX($B1:$E1);COUNT($B1:$E1)>0)

Click on New Style…, enter a Name of choice (e.g. Yellow), select Background and click on a fill colour of choice (e.g. Yellow 10), OK, OK.

The first B1 in the formula is not anchored (with $) so the conditional formatting automatically adjusts this reference as each cell in the range is tested in turn. The columns to test for MAX are anchored so the comparisons are consistent. The additional COUNT condition is to exclude the header row and any blank rows within the selected range which here has been kept open.

In Excel (i) in LTR left to right selection is generally advisable and (ii) both MAX and COUNT behave differently, in certain circumstances.

1 comment

We have markdown footnotes if you want to use them, use [^1] at the marker and [^1]: footnote at the bottom of your post (replace the 1 with the actual footnote number) ‭Moshi‭ 16 days ago

Sign up to answer this question »