Laura Sheldon
asked on
Excel 2007, conditional formatting cells based on if function
I'd like to know how to lay out the formula, if it's even possible, to use cond formatting to change the appearance of one set of cells based on the contents of another set of cells.
Using example spreadsheet, I want to recolor the cells to the right of the black line a different color, or bold them (doesn't matter how it's represented) based on whether the cells to the left of the black line are 0 or -1 (true or false result from exported DB query).
Thanks, Laura example-for-cond-formatting-1117.xlsx
Using example spreadsheet, I want to recolor the cells to the right of the black line a different color, or bold them (doesn't matter how it's represented) based on whether the cells to the left of the black line are 0 or -1 (true or false result from exported DB query).
Thanks, Laura example-for-cond-formatting-1117.xlsx
Highlight from C2 all your data, then CF - formula =$A2=0 and select your formatting
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
slow fingers :)
I have attached the modified file. check it.
I first applied the format to all the rows and then removed it from the first column.
Check the conditional formatting rules under conditional formatting menu under the home section.
example-for-cond-formatting-1117.xlsx
I first applied the format to all the rows and then removed it from the first column.
Check the conditional formatting rules under conditional formatting menu under the home section.
example-for-cond-formatting-1117.xlsx
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Patrick - if you work out words per minute you were probably quicker than me ...
These guys, including MatthewPatricks are the super experts...and I know you want a formula..but I can only offer vba...so if it helps...
If cell A1 id = -1 then it will search that row for a value and change to bkgrnd color to orange...otherwise next row and so on..if A1 = 0 ..then move on..
If cell A1 id = -1 then it will search that row for a value and change to bkgrnd color to orange...otherwise next row and so on..if A1 = 0 ..then move on..
Function change_cells()
Dim i As Long
i = 1
For i = 1 To 65000 ' U
If Cells(i, "A").Value <> "" Then 'p
' IF -1 THEN WE ARE IN THE RED!!
If Cells(i, "A").Value = "-1" Then 'o
'FORMAT THE CELLS THAT SHOULD BE RED...
If Cells(i, "C").Value <> "" Then
Cells(i, "C").Interior.ColorIndex = 45
Else: End If
'--
If Cells(i, "D").Value <> "" Then
Cells(i, "D").Interior.ColorIndex = 45
Else: End If
'--
If Cells(i, "E").Value <> "" Then
Cells(i, "E").Interior.ColorIndex = 45
Else: End If
'--
If Cells(i, "F").Value <> "" Then
Cells(i, "F").Interior.ColorIndex = 45
Else: End If
'--
If Cells(i, "G").Value <> "" Then
Cells(i, "G").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "H").Value <> "" Then
Cells(i, "H").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "I").Value <> "" Then
Cells(i, "I").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "J").Value <> "" Then
Cells(i, "J").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "K").Value <> "" Then
Cells(i, "K").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "L").Value <> "" Then
Cells(i, "L").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "M").Value <> "" Then
Cells(i, "M").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "N").Value <> "" Then
Cells(i, "N").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "O").Value <> "" Then
Cells(i, "O").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "P").Value <> "" Then
Cells(i, "P").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "Q").Value <> "" Then
Cells(i, "Q").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "R").Value <> "" Then
Cells(i, "R").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "S").Value <> "" Then
Cells(i, "S").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "T").Value <> "" Then
Cells(i, "T").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "U").Value <> "" Then
Cells(i, "U").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "V").Value <> "" Then
Cells(i, "V").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "W").Value <> "" Then
Cells(i, "W").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "X").Value <> "" Then
Cells(i, "X").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "Y").Value <> "" Then
Cells(i, "Y").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "Z").Value <> "" Then
Cells(i, "Z").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AA").Value <> "" Then
Cells(i, "AA").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AB").Value <> "" Then
Cells(i, "AB").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AC").Value <> "" Then
Cells(i, "AC").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AD").Value <> "" Then
Cells(i, "AD").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AE").Value <> "" Then
Cells(i, "AE").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AF").Value <> "" Then
Cells(i, "AF").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AG").Value <> "" Then
Cells(i, "AG").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AH").Value <> "" Then
Cells(i, "AH").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AI").Value <> "" Then
Cells(i, "AI").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AJ").Value <> "" Then
Cells(i, "AJ").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AK").Value <> "" Then
Cells(i, "AK").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AL").Value <> "" Then
Cells(i, "AL").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AM").Value <> "" Then
Cells(i, "AM").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AN").Value <> "" Then
Cells(i, "AN").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AO").Value <> "" Then
Cells(i, "AO").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AP").Value <> "" Then
Cells(i, "AP").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AQ").Value <> "" Then
Cells(i, "AQ").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AR").Value <> "" Then
Cells(i, "AR").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AS").Value <> "" Then
Cells(i, "AS").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AT").Value <> "" Then
Cells(i, "AT").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AU").Value <> "" Then
Cells(i, "AU").Interior.ColorIndex = 45
Else: End If
'-
If Cells(i, "AV").Value <> "" Then
Cells(i, "AV").Interior.ColorIndex = 45
Else: End If
Else 'O
End If 'O
Else 'P
Exit For
End If 'P
Next ' U
MsgBox "Task Complete", vbOKOnly
End Function
sorry ....MatthewsPatrick
ASKER
GlobaLevel: I'll give that a try in something else I'm trying I'm hoping it might work, but thanks for the input!
ASKER
Y'all are the best! Thanks for the help!