Google Sheets - Conditional Formatting - Counting In Reverse - google-sheets

I have a simple Google Sheet. On this sheet I am tracking a small budget. This includes the following:
Total budget
Expenses (as line items)
Total expenses
Remaining budget
What I am trying to do is setup conditional formatting so that the cell holding the Remaining budget changes colors based on the total being displayed. That part is straight forward. The issue I am running into is that the Remaining budget is displaying the Total budget minus the Total expenses.
The conditional formatting is assuming that this number is counting up instead of down. When I put the formatting rules in, they are displaying in reverse of what I am wanting.
Is there a way to have the conditional formatting do what its doing based on the numbers subtracting rather than adding?
I did try looking for someone else with this same question, but I didn't see anything that quite fit my issue.
I have shared the Google Sheet at the following link and allowed Editor rights on this link. You can find the Google Sheet HERE.

Based on my understanding, your main goal is to set the cell color to red when the budget left is zero, and change its color scale to green as the budget left increases.
You just need to change your Minpoint and Maxpoint number and color configuration.
As your budget runs out, it should change its color to red:
When your remaining budget is equal to your midpoint, it should change its color to yellow:

See my added sheet, "Erik Help." All I did was swap the order of your numbers (0, 600, 601) and then click on both the red and the green paint cans for the top and bottom and swap those (i.e., red for green, green for red).
ADDENDUM: Looks like "Ron M" explained this for you. I've implemented that in my added sheet. Please mark Ron's reply post as "Best Answer," since it will help future site visitors most, based on the visuals.

Related

I'm looking for a Google Sheet array function to add specific increments in each row

Here's how it looks.
Hi. I'll try to be as specific as possible about this :)
I'm making a Google Sheet page similarly to a game character progression, that will automatically fill up based on data from other sheets: specifically, these "EXP" bars fill up with values based on the hidden cell A5.
For instance, the cells from D5 to BA5 represent LV1.
As the function shows, every time the value in A5 reaches an even number (for LV1, it's all even numbers from 2 to 100), one of the slots will fill up with a number, that with conditional formatting, will change the color of the cell and make it look like an actual exp bar filling up.
I'm using the function =COUNTIF(A5,">=2") and manually changing it to ">=4", ">=6" etc until ">=100" for the first bar. The second bar will have its 50 cells with all even numbers from ">=102" to ">=200".
So, to get to the question: is there an array formula that facilitates the process of filling a great amount of these bars with functions, without changing them all manually? Even automating *some *of this process would be great. Besides it being tedious, it leaves a lot of room for human error.
Thank you in advance to whoever's got an answer.
P
I haven't tried much as at the moment I am very confused by the vast amount of options array formulas provide. I have 48h of experience in the matter.
I suggest you to use the values of columns and rows here as helpers to do calculations. If you know that every column adds 2 and every row adds 100 you can set a formula like this for the whole range (select the whole range and add just one rule of conditional formatting):
=$A$5>((Column(D5)-3)*2+(Row(D5)-5)*100))
You use $symbol to make A5 steady and D5 value will "move" to each cell for conditional formatting, so you don't have to make an ARRAYFORMULA for this

Google Sheets: How Do I Colour A Cell In 2 Cases Context Based on Values From Another Sheet

I'm trying to create a heads up display on the number of Hints a user has collected in a contest.
There are different categories of hints here.
So I'm trying to create a process such that in the respective Hints tab (ie Bonus Hint in this case)
Filling in Column B (with the hint description), renders that Hint as being "obtained" and hence showing up "Green" in my Hints Overview sheet.
However, for "unobtained" hints, by not filling in Column B, I want my Hints Overview to instead still show the Hint number but in light gray (as illustrated below)
I dont want the unobtained hints to be empty cells. I want to make them looked grayed out. ^^^
I tried pulling some conditional formatting tricks like indirect(), ISBLANK() but something about CF just doesn't allow me to get what I desire.
And the other challenge is that because I arranged my headsup-display to be grid-like, the cell filling has to take on horizontal filling. Its not like as I can simply drag and fill 250 rows vertically.
How can I pull these things off in Google Sheets? (trust you guys to please dont maliciously edit my sheet out of mischief)
https://docs.google.com/spreadsheets/d/1IG6l0xkJSU-mxP6YVr73RwinEcdxSePI4HN02KF-WoA/edit?usp=sharing
delete everything in DASHBOARD!D8:AB17
use this in D8:
=SEQUENCE(10, 25)
remove your green CF rule and set the font to gray
now add this new CF rule as custom formula:
=INDEX(VLOOKUP(D8, {ROW(INDIRECT("BONUS!B2:B"))-1, INDIRECT("BONUS!B2:B")}, 2, 0))<>""
and set background to your green and font to white
also change DASHBOARD!AD17 to:
=COUNTA(BONUS!B2:B251)

Counting the Number of Empty Cells between Non-Empty Cells in Google Sheets

I'm trying to count the number of empty cells that exist in a column between each non-empty cell but haven't been able to work out how.
Using this, I'm also trying to find the largest "empty distances" and locate the cell in the center of these distances.
The sheet I'm working with lists a set of marker colors and denotes the ones that are owned out of the full set of colors. I'm trying to find the largest ranges of missing colors and then find the colors in the middle of those ranges in order to find a handful of markers that would best help to fill out the spectrum.
Columns 1-6 are information- Column 7 marks whether the color is owned:
I may have an answer that helps you.
I could only get it to work using a helper column, but someone may know how to eliminate that requirement.
The helper column creates an array, basically listing the row numbers of the rows that have an "x" in your column B.
The main formula then measures the gap between each of these listed row numbers. It also checks the gap before the first "x", and after the last "x". Note that I have the data starting on row 2, which complicates the formula, but makes the sample sheet clearer - this can easily be changed to row 1 if you prefer.
={F2-1;
query(ArrayFormula(if(isnumber(F3:F),F3:F-F2:F-1,"")),
"select Col1 where Col1 > 0",0);
counta(A2:A)-indirect("F"&COUNTA(F$2:F))}
See a sample sheet here:
https://docs.google.com/spreadsheets/d/19QUFGRqTT6BqOsBrEBpTIxQCeNdRa5mzXhxQpCZ8sV4/edit?usp=sharing
Then I used a second formula to calculate the max gap between "x"s, (or before the first or after the last x).
Note that calculating the midpoint of the gaps, and doing a lookup of the corresponding mid-point colour, is something that can be added to this answer, if you share a sample copy of your sheet and share it for editing.
Let me know if this helps. I'll add more explanation to describe what the formula is doing tomorrow.
And I'll provide a second tab with the formulas adjusted to work with data beginning on row 1.
You can also get the lengths of the gaps using Frequency:
=ArrayFormula(frequency(if((B1:B20<>"X")*(A1:A20<>""),row(B1:B20)),if((B1:B20="X")*(A1:A20<>""),row(B1:B20))))
but finding the centres of the gaps and allowing for equal-sized gaps is more difficult.
This should find the position of the "X" at the end of the longest gap:
=ArrayFormula(
sum(frequency(if((B1:B20<>"X")*(A1:A20<>""),row(B1:B20)),
if((B1:B20="X")*(A1:A20<>""),row(B1:B20)))*(sequence(countif(B1:B20,"X")+1,1)<=
match(max(frequency(if((B1:B20<>"X")*(A1:A20<>""),row(B1:B20)),
if((B1:B20="X")*(A1:A20<>""),row(B1:B20)))),frequency(if((B1:B20<>"X")*(A1:A20<>""),row(B1:B20)),
if((B1:B20="X")*(A1:A20<>""),row(B1:B20))),0)))+
countif(sequence(countif(B1:B20,"X")+1,1),"<="&
match(max(frequency(if((B1:B20<>"X")*(A1:A20<>""),row(B1:B20)),
if((B1:B20="X")*(A1:A20<>""),row(B1:B20)))),frequency(if((B1:B20<>"X")*(A1:A20<>""),row(B1:B20)),
if((B1:B20="X")*(A1:A20<>""),row(B1:B20))),0))
)
and then it should just be a case of working backwards from there to the centre of the longest gap. However the formula needs further refinement to deal with the cases
(1) Where the longest gap is after the last "X"
(2) Where there is a tie for the longest gap
(3) Where there is a need to list the longest, second longest, third longest gap etc.

Google Sheets, Conditional Formatting by Percentage Categories

I'm looking to create some conditional formatting based upon a set of three percentage categories (please see the following sheet), where a color is applied to multiple cells, but not all in a row:
90% - 100%: Green
50% - 89%: Yellow
0% - 49%: Red
I'm able to get the percentages to change color based upon their content, but so far I've not been able to apply this change to the other cells. Is there a conditional formatting custom formula that I can use to do this?
For range F3:H26 make 2 rulus with 'your formula':
=$F3>=0.9 -- green
=$F3>=0.5 -- yellow
and paint the range in red.
That's it!
Look at example
Select all the cells that you want the rule to apply to
Go to: Format > conditional formatting then in the tool bar on the right, click add new rule
By format cell if section select "is between" and enter the criteria. Hit done
Now click add new rule below the first one and repeat as above
this should work
When putting in conditional formatting with cell that has a percentage value in it you need to give ranges in the range of 0 to 1. In other word to set a format for range between 10% and 40% you would select "Is Between" and for values put in 0.1 and 0.4. This will apply formatting correctly. For percentages over 100% use 1.xx over 200% 2.xx etc...

Change color of cell if sum of row drops below 2

I'm working on a sheet to help me keep track of inventory at a bookstore. Here is a watered down version. There are 19 titles in total, kept at three different warehouses. I'm working on a notification system where the top box will turn red if the sum of books in any single title drop to 3, so I know it time to restock.
How can I do that?
NOTE: I can't add another column to get the sum value. The original spreadsheet is pretty crowded as it is.
The full sheet is in the copy of Inventories.
A custom formula in conditional formatting to achieve this:
=ARRAYFORMULA(MIN(SUMIF(IF(COLUMN(C3:E3),ROW(C3:C21)),ROW(C3:C21),C3:E21))<3)

Resources