Frage

Data:

  • B1: =GoogleClock // This function shows the hour in real time. 28/11/2013 15:45:00
  • C3: 0:15:00 //Time in hours
  • E3: 28/11/2013 15:45:00
  • F3: =SUM(E3+C3) //Result will be 28/11/2013 16:00:00
  • G3: =IF(C3>0;IF($B$1>=$F3;"Call";"In Time");" ")

The formula will check if B1 >= F3 the resul will Call if not In Time.

As you see in this example right now is 15:45 and the G3 will show "In Time" but when the =googleclock function mark 28/11/2013 16:00:00, G3 will change the value to Call. In that moment the background should be change from gree to Red-

Situation:

I have a formula in the Column G, the result of that formula "Call" or "In Time".

I set a conditional formatting using Menu > Format > Conditional Formatting to Column G. but the conditional only work for the existing rows.

Problem:

If I add new rows the Conditional Formatting is not set to that news rows.

Once solution is create a script that detect the value in the cell, and if the Value is Call turn backgroundcolor to Red and if In Time turn to green.

If I set this script to run in OnEdit or Run every 5min or Min the system will turn slow because this script will check the value every time.

Does exist any way to set conditional formatting like as I set from menu?

War es hilfreich?

Lösung

Range.copyTo() can copy conditional formatting.

For example, this snippet will copy the conditional formatting from cell A1 to the rest of the column:

function copyFormat() {
  var source = ss.getRange('A1');
  var destination = ss.getRange('A2:A');
  source.copyTo(destination, {formatOnly:true});
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top