Complex conditional formatting can be achieved in Google Spreadsheets using Google Apps Script. For example, you could write a function that changes the background colour of an entire row based on the value in one of its cells, something that I do not think is possible with the "Change color with rules" menu. You would probably want to set triggers for this function such as "On Edit", "On Open" and "On Form Submit".
Documentation for setBackgroundRGB() function
UPDATE: Here is a Google Apps Script example of changing the background color of an entire row based on the value in column A. If the value is positive, use green. If empty, white. Otherwise, red. See the results in this public Google Spreadsheet. (You will have to be signed in for the script to run, but without signing in you can still see results).
function colorAll() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 2;
var endRow = sheet.getLastRow();
for (var r = startRow; r <= endRow; r++) {
colorRow(r);
}
}
function colorRow(r){
var sheet = SpreadsheetApp.getActiveSheet();
var dataRange = sheet.getRange(r, 1, 1, 3);
var data = dataRange.getValues();
var row = data[0];
if(row[0] === ""){
dataRange.setBackgroundRGB(255, 255, 255);
}else if(row[0] > 0){
dataRange.setBackgroundRGB(192, 255, 192);
}else{
dataRange.setBackgroundRGB(255, 192, 192);
}
SpreadsheetApp.flush();
}
function onEdit(event)
{
var r = event.source.getActiveRange().getRowIndex();
if (r >= 2) {
colorRow(r);
}
}
function onOpen(){
colorAll();
}
You can conditionally format based on another cell or column by selecting your cells, and making a conditional formatting rule for cells "Greater Than" the cell "A1" as shown below.
Sheets uses this as a relative reference that you're comparing the cell to the left of each cell in your selection.
Best Answer
When you use a relative reference, such as B17, to format a range, it will be used in a relative way. That is:
If the goal is to compare all cells in the range to B17, use the absolute reference B$17 as pnuts suggested.