Conditional formatting - first value lower than

I need to select only the first number in sorted order.

For example, I have a line:

10000 8250 6500 4750 3000 1250

All I need to do is select the first cell, which is less than 5000. Thus, the value 4750 will be "green", but the other two cells after this cell will again be without formatting.

+4
source share
3 answers

A cold question, because the formula must take into account the first value. My solution uses conditional formatting with the following formula:

=COUNTIFS($G25:G25,"<5000")=1

25:25 - , G25. G COUNTIF ​​ .

+1

- " ", , . , - , , . , ,

=AND(INDIRECT("RC[+1]";0)F8;ISBLANK(INDIRECT("RC[-1]";0)));NOT(INDIRECT("RC[-1]";0)INDIRECT("RC[+2]";0))))
0

.

B1:H1 ( ):

10000   8250    6500    4750    4750    3000    1250
10000   8250    6500    5000    5000    3000    1250
10000   8250    6500    4750    4750    3000    1250

, J1, :

=INDIRECT(CHAR(64+MATCH(4999,B1:H1,-1)+2)&ROW(H1))

5000.

The custom formatting formula will now look like this:

=IF(AND(B1=$J1,B1<A1),1,0)

This way you avoid duplicating Green values, and that explains why I didn't start with a column A.

0
source

Source: https://habr.com/ru/post/1669323/


All Articles