May 31, 2021

Alternating Colors Don't Work; Neither Does Conditional Formatting

I am using google sheets in order to organize roleplaying information so please excuse me for not linking a copy of the actual sheet here. 

My problem is that I cannot get alternating colors work, but only on one specific tab. I figured out that I could work around the issue with a custom conditional formatting code and that was fine for a time. The problem is that I took the same code and attempted to apply it to a different range of that same tab and I absolutely cannot get it to work.


I originally attempted to use =MOD(ROW(),2)=0 but it failed to work, causing the entire range to show up as a single color. I changed it to 4 instead, and I assume it works now because each currently presented row is actually two rows merged together.


I have no idea why this code will work in one part of the tab and not the other. I copy pasted the section to see if it would work. It did not. I nuked the entire area with the Clear Formatting and retyped the code by hand to see if it would work. It did not.


The only problem is that I want the first row to be colored instead of white and have the colors alternating from there. I was actually fine with this code working correctly with the 1 instead of the 0 because I assumed that I could change the range of the code and have it simply shift down a row. What I mean by this is that the first red column would be excluded from the conditional formatting so that it would also be white. From there, I would have simply colored the first row (which is currently white) with the fill bucket and it would have been fine.

The problem with this plan is that it doesn't matter what I do. That red row that I want to make white? It stays red.


Or, worse, it actually does turn white but not in the way I want.


For clarity's sake, the first row of this range is 39. I haven't been shifting the screenshots so the first row in every screenshot is also row 39. 


Anyways, if anybody can help me, please do. It's extremely annoying, even if it's not that serious of an issue.
Locked
Informational notification.
This question is locked and replying has been disabled.
Community content may not be verified or up-to-date. Learn more.
Last edited May 31, 2021
Recommended Answer
May 31, 2021
Hi Tiffany,
 
We want to help, but it does make it much harder for us, especially with sheet-specific issues like conditional formatting rules, without a shared sheet.  Given the text as you've used in your pictures, I'm not sure why you couldn't share a brand new sheet with just that same text, but structured with your double rows, so that we could test and prove some CF rules.  It's hard to grasp everything you've mentioned from looking at a lot of images.
 
BUT, here's my attempt at understanding what you've described...
 
I think you have a merged cell, spanning two rows, in your first column.  It seems that your whole row across is perhaps merged cells from two rows, but I'm not sure about that.  Merged cells can cause a lot of problems processing data, and usually there are ways to achieve the same effect without merging cells, but that is a separate discussion.
 
In any case, try this formatting rule, applied to range A39:D in my test case.  This should work whether or not your entire row is composed of merged cells (from two rows) or not.
 
=ISODD(ROUNDDOWN((ROW(A39)-1)/2))
 
By dividing the ROW() by two, and using rounding, we get two adjacent rows being treated the same.  I use the minus one to align things correctly for row 39, and changing ISODD to ISEVEN controls whether we start the first row as coloured or white.  See image below.
 
Just to be clear, the cells with "Text on Row 39" and "Text on Row 40" can be merged together vertically, if that is your need, the same as is done in column A, without affecting the formatting.
 
Column F values are just for demo purposes, and can be deleted.
 
I hope this helps!
Cheers,
Gill
 
 
 
Original Poster Tiffany Yeung marked this as an answer
Helpful?
Recommended Answer
May 31, 2021
I'm glad it helped, Tiffany.
And the many experts in this forum always love to take on challenging spreadsheet problems!
 
If you have other questions in the future, please take a look at this post about Best Practices When Asking a Question and share a sheet that has the permissions set for “Anyone with link” can EDIT?  This will also guide you in avoiding sharing any sensitive data.  
 
And when you've received a response that answers your question, please observe these forum courtesies;
 • Leave your demo sheet shared as part of this solution's archive,
 • Click Recommend on the post that best addressed your question, and
 • Post again soon!
 
Cheers!
Gill
Original Poster Tiffany Yeung marked this as an answer
Helpful?
All Replies (5)
Recommended Answer
May 31, 2021
Hi Tiffany,
 
We want to help, but it does make it much harder for us, especially with sheet-specific issues like conditional formatting rules, without a shared sheet.  Given the text as you've used in your pictures, I'm not sure why you couldn't share a brand new sheet with just that same text, but structured with your double rows, so that we could test and prove some CF rules.  It's hard to grasp everything you've mentioned from looking at a lot of images.
 
BUT, here's my attempt at understanding what you've described...
 
I think you have a merged cell, spanning two rows, in your first column.  It seems that your whole row across is perhaps merged cells from two rows, but I'm not sure about that.  Merged cells can cause a lot of problems processing data, and usually there are ways to achieve the same effect without merging cells, but that is a separate discussion.
 
In any case, try this formatting rule, applied to range A39:D in my test case.  This should work whether or not your entire row is composed of merged cells (from two rows) or not.
 
=ISODD(ROUNDDOWN((ROW(A39)-1)/2))
 
By dividing the ROW() by two, and using rounding, we get two adjacent rows being treated the same.  I use the minus one to align things correctly for row 39, and changing ISODD to ISEVEN controls whether we start the first row as coloured or white.  See image below.
 
Just to be clear, the cells with "Text on Row 39" and "Text on Row 40" can be merged together vertically, if that is your need, the same as is done in column A, without affecting the formatting.
 
Column F values are just for demo purposes, and can be deleted.
 
I hope this helps!
Cheers,
Gill
 
 
 
Original Poster Tiffany Yeung marked this as an answer
May 31, 2021
Oh, I did not add an example sheet because some of my friends told me that alternating colors and conditional formatting would break for no discernible reason (to us) between sheets. I guess that was just a misconception between us. Good to know otherwise!

Anyways, I tried out =ISODD(ROUNDDOWN((ROW(A39)-1)/2)) and it works! Thank you so much, hopefully I will not need a new code everytime I try to use this set up.
Recommended Answer
May 31, 2021
I'm glad it helped, Tiffany.
And the many experts in this forum always love to take on challenging spreadsheet problems!
 
If you have other questions in the future, please take a look at this post about Best Practices When Asking a Question and share a sheet that has the permissions set for “Anyone with link” can EDIT?  This will also guide you in avoiding sharing any sensitive data.  
 
And when you've received a response that answers your question, please observe these forum courtesies;
 • Leave your demo sheet shared as part of this solution's archive,
 • Click Recommend on the post that best addressed your question, and
 • Post again soon!
 
Cheers!
Gill
Original Poster Tiffany Yeung marked this as an answer
May 31, 2021
Thank you! I hope this is right?

May 31, 2021
That's great, Tiffany, I'm so glad you got something that works for you!
Thanks for sharing.
Gill
false
8898271811257655462
true
Search Help Center
true
true
true
Search
Clear search
Close search
Main menu
true
true
35
false
false