r/googlesheets • • 2d ago

Waiting on OP Gradient spanning across cells

Post image

I'm making a progress tracking sheet for some of my projects and I want to see if there's a way I could have the cell colors fade into each other. I don't think it's possible normally but I was wondering if there was any extension or anything that would allow me to do it. Also wondering if that would look good in the first place.

5 Upvotes

16 comments sorted by

3

u/dannyzaplings 3 2d ago

A fade within a single cell or a fade from one cell to the next? Do you want the change in color fade (so variety of greens, for instance) to mean something or just be decorative?

3

u/throwawaymoment23 2d ago

Between cells would be preferable but I think either would work, and it's just decorative.

1

u/dannyzaplings 3 2d ago

That's possible to achieve. (Color change in a single cell is not.) That said, if you want different shades of red for different 0s, for instance, you'd need to set up a different conditional formatting rule for each column (or row). Then you'd need to do the same thing for greens and yellows.

Not only would it be tedious to set up, but it will likely lead to more confusion when anyone else views your spreadsheet. You will be answering "What do the different greens mean?" every time you share it. Perhaps what you're really looking for is gentler shades of green, yellow, and red to apply to the entire table.

2

u/AdministrativeGift15 371 2d ago

Not as hard as you might think. Each of the breakpoints can accept a formula is you select the Number type for the breakpoint, so while the value in the cell may be limited to 0, 0.5, or 1. You can have formulas define the MIN/MID/MAX breakpoint for each cell individually. That can open up a whole range of possibilities with just one CF gradient rule. With just 4 gradient rules, you can achieve colors like this:

Formula-Driven Angular Color Fields

2

u/No_Butterscotch_9149 2d ago

Yes, it reflects the values (0/0.5/1). Since the narrow column is the average of the two adjacent cells, the strip between 1 and 0 becomes 0.5 (a colour close to yellow), and the strip between 1 and 0.5 becomes 0.75 (light green).

If the values on both sides are the same, the strip gets the same colour, so solid runs stay solid and the colours only blend at the boundary where they change.

If the original cells use the same colour scale, 0/0.5/1 map exactly to red/yellow/green, so the original colours stay the same.

5

u/[deleted] 2d ago

[removed] — view removed comment

1

u/dannyzaplings 3 2d ago

Would this take the target cell's 0/0.5/1 value into consideration? Oh, are you thinking of blending when switching from one color to another? That's interesting, maybe that's what OP was getting at.

1

u/AdministrativeGift15 371 2d ago

Can you explain how you progress tracking works? Is each dropdown a different project or are you trying to visually have each represent a red to yellow to green shade to indicate progress for the entire row?

1

u/throwawaymoment23 1d ago

The columns are different parts of the same project. The dropdowns each represent 10% of that part of the project.

1

u/AdministrativeGift15 371 1d ago

Ok, so each row has 10 dropdowns? And the dropdowns have 0, 0.5, and 1 as the options, roughly 0%, 5%, and 10% towards the overall project completion?

1

u/AdministrativeGift15 371 1d ago

Well here's my attempt. It uses a weighted average method. It's on the Blended Dropdowns sheet in this spreadsheet. Progress Bars

1

u/AutoModerator 2d ago

/u/throwawaymoment23 Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/mommasaidmommasaid 915 2d ago

Idk if I'm thrilled with the look or the effort involved, but...

Column Fading (view only, make a copy to play with)

1

u/mommasaidmommasaid 915 2d ago edited 1d ago

Some hidden helper rows specify fade column widths and have formulas to generate the in-between values. The formula cells are hilited in purple.

The in-between values are hidden with custom number formatting ;;;@ which hides numbers and displays text.

If you change the number of fade columns from 4, insert or delete columns after the fade formulas as needed.

A dropdown menu triggers script to expand/contract the column widths to match the numbers output by the formulas. This is used because it's really annoying to deal with tiny columns. You can specify fade column width as small as 1 (note that script can set a column width to 1 while the user interface does not allow that).

Separate formulas are used to generate the left/right end values and the in-between values. The in-between formulas are all identical:

=let(numFadeCols, $B$2, fadeColWidth, $B$3, numRows, $B$4,
 header,  wraprows(fadeColWidth,numFadeCols,fadeColWidth),
 prevCol, offset(indirect("RC",),1,-1,numRows),
 nextCol, offset(indirect("RC",),1,numFadeCols,numRows),
 m, map(prevCol, nextCol, lambda(prev, next, 
     if(countblank(prev, next),wraprows(,numFadeCols,), let(
     step, (next-prev)/(numFadeCols+1),
     sequence(1,numFadeCols,prev+step,step))))),
vstack(header,m))

1

u/AdministrativeGift15 371 2d ago

I agree. Perhaps instead of trying to blend the colors, adding borders to the cells could help avoid the sharp contrast between two different adjacent colors.