ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Conditional Statement For Colored Cell Borders (https://www.excelbanter.com/excel-worksheet-functions/216551-conditional-statement-colored-cell-borders.html)

nvhelp

Conditional Statement For Colored Cell Borders
 
I need to write a conditional statement basically says:

If cell (for example, A1) is "Wrong" "Mistake" OR "Error" then the next cell
(say, A2) must have red borders.

Can someone please help?

Thanks

Pete_UK

Conditional Statement For Colored Cell Borders
 
Suppose you want this to apply to any of the cells in the range
A2:A30.

Highlight that range, starting with A2, and click on Format |
Conditional Formatting. In the pop-up, select Formula Is rather than
Cell Value Is in the first box, and in the next box enter this
formula:

=OR(A1="wrong",A1="mistake",A1="error")

Then click on the Format button, select the Borders tab, choose Red
from the Colors drop-down, then choose the style, then click on
Outline. Click OK twice to exit the dialogue box.

Then you can put any of those words in A1:A29 and the cell below it
will have a red border.

Hope this helps.

Pete

On Jan 14, 11:26*pm, nvhelp wrote:
I need to write a conditional statement basically says:

If cell (for example, A1) is "Wrong" "Mistake" OR "Error" then the next cell
(say, A2) must have red borders.

Can someone please help?

Thanks



T. Valko

Conditional Statement For Colored Cell Borders
 
Try this...

Select cell A2
Goto the menu FormatConditional Formatting
Select the Formula Is option
Enter this formula in the box on the right:
=OR(A1="wrong",A1="mistake",A1="error")
Click the Format button
Select the Borders tab
Select a line style (there aren't too many to choose from)
Select a color - red
Click the Outline icon
OK out

--
Biff
Microsoft Excel MVP


"nvhelp" wrote in message
...
I need to write a conditional statement basically says:

If cell (for example, A1) is "Wrong" "Mistake" OR "Error" then the next
cell
(say, A2) must have red borders.

Can someone please help?

Thanks




Harlan Grove[_2_]

Conditional Statement For Colored Cell Borders
 
Pete_UK wrote...
....
=OR(A1="wrong",A1="mistake",A1="error")

....

While you can't use arrays directly in conditional formatting, you can
refer to names defined as array constants. If the name TrapWords were
defined as

={"wrong","mistake","error"}

you could use the conditional formatting formula

=OR(A1=TrapWords)

Pete_UK

Conditional Statement For Colored Cell Borders
 
Thanks for that clarification, Harlan.

Pete

On Jan 15, 1:52*am, Harlan Grove wrote:
Pete_UK wrote...

...=OR(A1="wrong",A1="mistake",A1="error")

...

While you can't use arrays directly in conditional formatting, you can
refer to names defined as array constants. If the name TrapWords were
defined as

={"wrong","mistake","error"}

you could use the conditional formatting formula

=OR(A1=TrapWords)




All times are GMT +1. The time now is 08:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com