Filehost.ro - gazduire fisiere
Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Nou pe simpatie:
monaahmed2012 pe Simpatie
Femeie
25 ani
Calarasi
cauta Barbat
25 - 48 ani
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides /

[EXCEL] Highlight Rows Based on Value Change [CONDITIONAL FORMATTING]

Pagini: 1 Moderat de TRaP, TonyTzu
#1
TRaP
Moderator
Postari: 960
Source:
https://stackoverflow.com/questions/414 ... e-of-value

For this you need a helper column next to your table. Assuming the data you want to compare is in column D and the first empty column next to your table is column M, in M2 enter the following formula (regardless if row 1 is your header):
=MOD(IF(ROW()=2;0;IF(D2=D1;M1;M1+1));2)

Fill that down as far as you need, (then hide the column if you want).

Now highlight your entire data set - this selection of cells will be the ones that get shaded in the next step.

From the Home tab, click Conditional Formatting, then New Rule.

Select Use a formula to determine which cells to format.

In "Format values where this formula is true" put =$M1=1 ---- THIS IS WRONG, SEE POST #3

Click the Format button, click the Fill tab, then choose the color you want to shade with.

You can also add multiple conditions to the formula above, eg:
=MOD(IF(ROW()=2;0;IF(AND(D2=D1;F2=F1);M1;M1+1));2)


 
   
#2
TRaP
Moderator
Postari: 960
Also working
=INDIRECT("A"&ROW())<>INDIRECT("A"&(ROW()-1))

Source:
https://stackoverflow.com/questions/414 ... e-of-value


 
   
#3
TRaP
Moderator
Postari: 960
Something must be corrected in post #1

The correct formula for conditional formatting should be something like:

=MOD($A2;2)=1


 
   
Pagini: 1  
Mergi la