How To Shade Every Other Line in Excel with Conditional Formatting
HTML-код
- Опубликовано: 14 июн 2014
- ***Read the comments section for tweaks to the formula that are needed for different regions (and I posted a recent comment about Microsoft 365 (from a viewer in South Africa) down below in these video details.)***
Different versions of the program require different characters (commas vs. semi-colon etc.)
How to shade every other line on an Excel spreadsheet using conditional formatting.
First, select the area of the spreadsheet you wish to have alternating lines shaded.
Then From the Home tab --Conditional Formatting --New Rule --Use a formula to determine which cells to format --Format values where this formula is true:
=MOD(ROW(),2)=0
Select the Format button -- select a color for your alternating line shade --OK --OK
Alternately you can use these formulas:
=ISEVEN(ROW())
Select the Format button -- select a color for your alternating line shade --OK --OK (This will shade EVEN numbered rows)
=ISODD(ROW())
Select the Format button -- select a color for your alternating line shade --OK --OK (This will shade ODD numbered rows)
(October 2018) comment from a viewer regarding Microsoft 365: "On my version of Excel (Microsoft 365) the formula uses a semicolon in place of the comma. This took me a while to figure out. If the formula doesn't work for you try =MOD(ROW();2)=0. "
Alternately, you can use these formulas in conditional formatting if you specifically want to shade even numbered rows on color and odd numbered rows another color:
=ISEVEN(ROW())
Select the Format Button - select a color for your alternating line shade -- OK -- OK (This will shade EVEN numbered rows)
=ISODD(ROW())
Select the FORMAT button - select a color for your alternating line shade -- OK --OK (This will shade ODD numbered rows)
I find that saving a Spreadsheet with those tricky Formula's in it, is a useful tool, besides saving a Favorites folder for Excel Tricks I need!
@@robertweekley5926 please would you help me know how to save formulas in spreadsheet.
Awesome, thank you. This tutorial was precisely how I needed it presented; simple, easy to mirror/follow, and verbally clear.
I tried several videos and this is by far the best.
Thank you so very much.
Love the narration and explanation. Thank you for not making it so complicated.
I appreciate the simplicity of your explanation and practical application of the function
Excellent Video Pete! So simple but incredibly useful. You've just saved me a whole lot of time and effort. Thanks !
We can take a screenshot of the formula and get it whenever we need or we thank you for uploading this video and whenever we need it we will come to your video again and follow your instructions.
Well, Thanks a lot for uploading this video.
Hey man, thanks a lot. You saved my work! Clearly demonstrated, clearly spoken and clearly defined step by step. 100% worked.
super helpful and easy to understand - thank you so much! A better, more versatile option than if I was in the "Format Table" mode.
WOW!! The best and clearest instruction so far. Thank you! :)
I have been looking everywhere for this. Thanks for posting!
"MOD" is short for "modulus", which means "tell me what the remainder is when I do division". So it's saying take the row number and divide it by two. If the remainder is equal to zero (that is, if there's no remainder), highlight the row. This will highlight the even rows (as it does in the video). I believe if you change the zero to a one, it would highlight the odd rows.
Thanks for the info, this will come in quite handy.
You're a wizard Harry
Thanks.
Thank you. I was wondering why the opposite row for me was being formatted. Changing the zero to a one resolved my issue.
Thank you for this quick and easy solution. Excellent teaching approach. - Appreciated.
Fabulous tip and detailed demonstration of how to apply. Thanks Wheelie Pete!
Very simple, I really appreciate you taking the time!
Dear WheeliePete Thank you so very much. Its working and its perfect. Thanks again for helping all of us.
Sweet and to the point, everything needed to know in less than 4 minutes
Thank you WheeliePete for a useful video. Since I wanted my first row and every other row after that to be shaded, I found out that I had to move my data one row down. This made my first row to be "even row" which makes the formula return a true value.
Or you could alter the formula to say =1 instead of =0... it is really only checking "even" or "odd" so easy to adjust.
YOU ARE FANTASTIC. Thank you so much, so clear and easy to follow.
Thank you! Works GREAT! And if you want to skip the first line you can enter 1 instead of 0 for ex., =MOD(ROW(),2)=1
Thanks WheeliePete this video nails it big time in a short time.
Thanks so much for this video, I always wondered how to do this without bothering my expert co-worker in Montana via email/video chat. Easy explanation, I took notes to remember next time.
Thank you so much. short and straight to the point. I appreciate that especially when time is so precious. I will subscribe to your videos. Stay safe and thank you again ;)
Thanks for the description, it helped a lot
TFS...I needed every other column, and this video pointed me in the right direction. =MOD(COLUMN(),2)=0
This was awesome and easy to follow. Thank you so much.
Thank you 👏
You explained very well and it was easy to follow
Thank you so much for this. On my version of Excel (Microsoft 365) the formula uses a semicolon in place of the comma. This took me a while to figure out. If the formula doesn't work for you try =MOD(ROW();2)=0.
Are you in the U.S. or another country? I've come to learn that other countries have different standards for the separators so the program changes from region to region. This is the first comment regarding Microsoft 365 though. Thank you for posting.
Hi WheeliePete. I am in South Africa. I have noticed that if you search for help on Chrome they use a space in place of the comma or semicolon. This can be most frustrating until you figure it out. A big shout out for your tutorial video - best one I have come across. I rarely comment (stalker not a talker), so this shows how great your video was!!!
Oh, this did the trick for me. Romania here...
Thanks you so much for this tip. I was facing the same problem.
Awesome tutorial! Thanks for sharing the tip.
So very easy. Thanks for making this nice and uncomplicated
Excellent. Thank you very much, this just what I have been looking for
I enjoyed your video. It was very helpful. Thank you!
Find myself coming back to this video a lot. Thank you.
Honestly, it was one of the reasons I made the video; so I would know where I could find the code when I needed it. 😄
Excellent and simple, not often seen with techies.
I've come here more than once, having failed to remember how this is done. Thank you for posting this! I've hit the subscribe button - AND taken notes this time!
Truth be told, making the video was a way for me to be able to remember where I could find the information on how to do this too...lol
@@WheeliePete Like - Sharing your Secret discoveries! Nice!
Worked beautifully! Thanks!
So many thanks for sharing the format.
Excellent. Easy does it. =MOD(ROW(),2)=0
Thanks Pete...that was great and worked very well.
thanks for the video, it helps me a lot, save my time.
Thank you very much for this. Very helpful.
Very helpful and easy to follow! thank you!
Many thanks man! very well explained....
This is helpful! Thanks much!
VERY CLEAR AND EASY. THANK YOU.
Excellent!!! Worked very well !!!!!
Thank you, thank you, thank you, now I can move on and finish my assignment. I spent way too much time trying to figure this out.
Jode Gabriel I made this video because of the ridiculous amount of time I spent one day trying to figure this out at work. Figured I couldn't be the only one wanting to do this... :-)
Thank you.... Nicely detailed...
works for me... Thank you for the easy tip
Thank you so much for this video
I like this Sir,this is so incredible mmmmh i have learn a lot form this video.......... Thumbs UP
Very helpful! Thanks!
Thanks, this solved a quick issue for me.
Perfect. Thank you.
Thanks bro, you saved my life.
Tremendously helpful. Thanks WhelliePete
Great video thanks for the help
Great tip thanks and very clear.
Thank you so much! really helpful!
Thank you Sir, this was great.
Clean and easy. Thanks so much.
That worked out perfect man, Thank You!!!!!!!!!!!!!!!!!!!!
Thanks. Very helpful!
Thank you video was very helpful
Good tip and well demonstration
Thank you so much!!
You are a hero, thank you
Thank you! ❤
Thanks :-) The Spanish formula is: =RESIDUO(FILA();2)=0
Thankyou so much!!
thanks for your video
Great video, thank you!!!!!
THANK YOU , IT VERY HELPFUL TO ME ( SAYEED , UAE )
Brilliant. Thank you.
Thank you. You can also create a table out of the data and it will highlight every other row.. Thanks for sharing.
Thanks for this!
Thank you it worked
That is awesome, thank you
Thanks Bro. Very helpful..🫡
Thank You !!!
In case it doesn't work for you, this is what I had to do,
Check your system's regional settings to see what your "List Separator" is set to:
In Control Panel, search for Region then select Change date, time, or number formats, click the Additional settings... button, then look for List separator under the Numbers tab. In my case, I had it set to a pipe '|' because I was messing with some script that would change an XLS to a CSV and needed to end up with a pipe-separated file instead of a comma-separated one.
Either use that character to separate the values in your formulas or just change it back to comma and the formula finally worked for me
THANK YOU!!!!!
Thank you, sir!!
This was great
Thank you!
Thank god for this video because my current spreadsheet is almost 400 lines long and I did NOT want to do that by hand 🤣
Absolutely Not! Same if it was 400 Columns Wide, I suppose!
you are the man!
Thanks!
THANK YOU,
Good tip, well demonstrated and many thanks!
Here are a couple alternatives if it helps anyone (based on questions below)
*=MOD(ROW(),2)=1* .... for ODD numbered rows instead of even
*=MOD(ROW(),5)=0* ... for all the "fives & tens"
*=MOD(ROW(),12)=0* ... for anything divisible by 12 with no remainder (e.g. 12, 24, 36...)
*=MOD(COLUMN(),2)=0* ... for even numbered COLUMNS
etc. see how that works?
->> you can apply multiple rules to the same areas! So enter one color for EVEN rows, another color for ODD rows
->> if you forget to apply formatting colors or try multiple times then you are layering on multiple rules, so you may be able to select Conditional Formatting, Manage Rules (below New Rule)... and edit them.
->> you can TEST it: type it into a cell and see the result, such as enter =MOD(ROW(),2)=0 anywhere in ROW 2,4,6 etc. and it will show "TRUE". You CAN paste the formula into the rule, but you have to copy the TEXT not the CELL. :D
Incredible information, thank you so much.
Thanks :) works
Thank you so much.
Thank you.
Thanks a lot
Thanks sir
Thank you!!!
short video and very clear.
Thank you so much
Thanks
You can also convert the range into a table, it will prompt which table format you'd like, then select one with every 2nd band coloured