How to apply conditional formatting to specific row numbers in Google Sheets

I’m trying to highlight certain rows in my Google Sheets document based on their row numbers. Let’s say I want to format rows 6, 7, and 8 with a specific color or style.

I’ve been experimenting with custom formulas but can’t get them to work properly:

=ISNUMBER(FIND(ROW(),"6,7,8")) // highlights everything

=OR(ROW()=6,ROW()=7,ROW()=8) // only highlights row 6

What’s the correct approach to make conditional formatting work for multiple specific row numbers? I need a formula that will properly identify and format all the target rows I specify.

The OR formula approach is definitely correct, but there’s another method that might be easier to manage if you have many specific rows to format. You can use the MATCH function instead: =NOT(ISERROR(MATCH(ROW(),{6;7;8},0))). This formula checks if the current row number exists in your specified array of rows. The advantage is that you can easily add or remove row numbers from the array without making the formula too lengthy. I discovered this approach when working with reports where I needed to highlight header rows scattered throughout large datasets. Make sure to apply the range correctly as mentioned, but this formula tends to be more flexible when you need to modify which rows are highlighted later.

Your second formula should actually work correctly for highlighting multiple rows. The issue you’re experiencing with =OR(ROW()=6,ROW()=7,ROW()=8) only highlighting row 6 might be due to how you applied the conditional formatting rule. When setting up the rule, make sure you select the entire range you want to format first, not just a single cell. If you select only one cell and then apply the formula, it will only affect that specific selection. Try selecting your entire data range (like A1:Z100 or whatever your data spans) before applying the OR formula. I’ve used this method multiple times and it works reliably once you get the range selection right during setup.

just had this same issue last week! try using =COUNTIF({6;7;8},ROW())>0 instead. works perfectly for me when the OR formula acts weird. sometimes google sheets gets picky about how you apply conditional formating rules.