I think this should be a simple question and I think I've asked it before, but I can find the formula. I have a spreadsheet with Columns A-E. Row 1 is headings. For the rest of the spreadsheet (spanning to row 113) I want to shade every 8 rows, as the data is grouped in 8 rows per site. How do I do this either via formula or conditional formatting?
I can do alternating rows, but not alternating 8 rows.
In this case, I did the google and this link seems really good.
Link - ( New Window )
In this case, I did the google and this link seems really good. Link - ( New Window )
Note, I haven't seriously used Excel in a long time, just a thought.
=ISODD(CEILING(ROW()-1,8)/8) and applying the formatting to $A$2:$E$113
I remembered it being more difficult (i.e. more nested conditions). But, this was easy.
=isodd(rounddown((row()-2)/8),0)
=iseven(rounddown((row()-2)/8),0)
Quote:
I have grown to hate excel. You can get complicated with Conditional Formatting but with excel if you copy and paste data it will mess up the formatting. If you used paste special values then you will be find with the conditional formatting. I can come back later of I remember. Feel free to start a new threqd tomorrow if I do not respond by then.
One - I did paste values. Two, I did manage it with conditional formatting using this:
=ISODD(CEILING(ROW()-1,8)/8) and applying the formatting to $A$2:$E$113
I remembered it being more difficult (i.e. more nested conditions). But, this was easy.
robbie... do you have an alternative you like? Or just stuck hating excel but using it heavily?
robbie... do you have an alternative you like? Or just stuck hating excel but using it heavily?
Google Sheets allows you to do way more.
=iseven(rounddown((row()-2)/8,0))
Then, in the cell following the 8th "1", paste in this formula (in this case, the dummy column is C):
=IF(SUM(C2:C9)=8,0,IF(SUM(C2:C9)=0,1,C9))
Then copy paste that formula down the rest of the dummy column.
That should leave you with a column of binary 1s and 0s which alternate every 8 rows. Then you can use conditional formatting to highlight the 1s or 0s.
There is probably a more direct path, but this should work.
I use column A as the basis - but make sure whatever column is referenced there has a value for each row, given the COUNTA formula (ID field is best).
But other poster’s solutions work as well
=iseven(rounddown((row()-2)/8,0))
It was even easier. Only have to do it once the way I did it. In conditional formatting the formula is =ISEVEN(CEILING(ROW()-1,8)/8)
Format 1 color and apply to $A2:$E113
I actually ended up inserting 3 more locations AFTER I set this up. the conditional formatting applied correctly, although EXCEL created its own apply to values with a number of different ranges after each insertion.
But, bottom line, that formula works for 8 rows and applies to every other group of 8. No need for a second formula for a different color.
Quote:
=isodd(rounddown((row()-2)/8,0))
=iseven(rounddown((row()-2)/8,0))
It was even easier. Only have to do it once the way I did it. In conditional formatting the formula is =ISEVEN(CEILING(ROW()-1,8)/8)
Format 1 color and apply to $A2:$E113
I actually ended up inserting 3 more locations AFTER I set this up. the conditional formatting applied correctly, although EXCEL created its own apply to values with a number of different ranges after each insertion.
But, bottom line, that formula works for 8 rows and applies to every other group of 8. No need for a second formula for a different color.
Correct. I do this for other reasons. I usually make if more complex. I'll change all the cells to either black or a dark grey. I'll add an "and" function to the formula I put in this thread so that only lines with text will show up. Then I can use borders for all the cells the same as the background cells (either black or a dark grey) as a trick because you cannot use borders with conditional formatting which I still find really dumb.