0
votes

I'm making a google spreadsheet and got stuck in one point....

It's related to conditional formatting.

Basically I want to create conditional formatting in custom formula that will give BG color to the row based on task status in cell.

  1. in-progress = BG green
  2. for review = BG Blue
  3. Done = BG Grey

I have done 2 & 3 using the following formula:

Done:

Conditional Formatting>Custom Formula> `=indirect("F"&Row())=100` Range> `C2:C1006,D2:E13,F2:F1006,G14:G16,D17:E1006`

For Review it's =99

Now I need in-progress to be = >0 and <99

I hope the questions is clear, thank you.

2
added code formatting to long textGanesh Kamath - 'Code Frenzy'

2 Answers

0
votes

Answer will be: =$F:$F>0 Range> C2:F1006

0
votes

What you are describing should be able to be done through the conditional formatting interface: Format > Conditional Formatting

You can add multiple condition rules for a given range so you would add

  • Text is exactly: "in-progress" (case sensitive); Format: background color green
  • Text is exactly: "for review" (case sensitive); Format: background color blue
  • Text is exactly: "Done" (case sensitive); Format: background color grey

When using conditional formatting, I find it best to use data validation as well (Data > Validation). If you choose the validation criteria as "list of items" and choose the option to display in-cell button, you can create a dropdown menu in each cell for your range, keeping you from having to type it each time

If you are absolutely set on creating a formula from scratch using apps script, take a look at this post on a similar topic and see if it could be adapted for your purposes. This is probably not the most effiect way to tackle the problem however.

As another thought, it sounds like you may be trying to create some kind of version of a work tracker. For something a little more intuitive, you may want to consider a Kanban app such as the free Kanbanchi which integrates with Google Drive nicely.

Edit:

With the new google sheets, you are able to do conditional formatting based on a custom formula. This means that you can base the color of a range based on a specific cell reference. Here are the 3 custom Formulas you could use:

  • =IF($A$2 = "In Progress", 1,0)>0
  • =IF($A$2 = "For Review", 1,0)>0
  • =IF($A$2 = "Done", 1,0)>0

Where $A$2 is the cell for reference that will contain the status. The only downside to this method is that you have to set the formula for each line. Because of this, you may want to make a "template" doc that you copy when you need a new document.

For more information on how to use the advanced conditional formatting features, take a look at this help article.