The following article provides detailed instructions for alternating row and column colors in Excel.
1. Alternating row colors
Step 1: Open Excel file -> Select the rows to alternate colors -> Go to the HOME tab -> Conditional Formatting -> New Rule…

Step 2: A dialog box appears, select Use a format to determine which cells to format -> in the Format values where this formula is true section, enter the formula =MOD(ROW(),2) (use comma or semicolon depending on your version) -> Click Format to choose the fill color.

Step 3: Select the Fill tab -> choose the fill color under BackGround Color -> OK.

Result:

Step 4: To change the fill color again, follow these steps:
Go to the HOME tab -> Conditional Formatting -> New Rule…

Step 5: A dialog box appears, click Format select the fill color from the dialog box.

Result:

2. Alternate column colors
Similar to alternating row coloring, but:
- In Step 1: Select the column to color.
- In Step 2: Enter the formula = MOD (COLUMN(),2).

Result:

3. Alternating row and column coloring with data and no data condition
If the column is at an odd (or even) position and contains data => apply color. If the column is at an even (odd) position and contains data, do not color.
Similar to the above steps but in step 2 enter the following formula:
= And (Mod(Row(),2),CountA($A1:$G9): This command will color odd-positioned rows with data if no data is present, or not color even-positioned columns.

Result: Row 4 contains data but remains uncolored because it is an even cell.

You can also reverse the logic by coloring even rows with data, leaving odd rows with or without data uncolored, using the command: = And(Mod(Row(),2)>0,CountA($A1:$G9).
Here are some tricks for alternating row and column coloring.
Wishing you success!