View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
joeu2004 joeu2004 is offline
external usenet poster
 
Posts: 2,059
Default Either cell but not both

On Jun 8, 3:23*pm, Mr X Z wrote:
1. Is it possible to restrict an entry to either one
of two cells but not both?
I had thought Conditional formatting


It depends on what you mean by "restrict".

With Conditional Formatting, you can highlight the error, but you
cannot prevent ("restrict") it. For example, if only one of B1 and B2
should be non-empty, select B1 and B2, and enter the following CF for
both:

Formula Is: =AND(ISBLANK($B$1)=FALSE,ISBLANK($B$2)=FALSE)

and select an appropriate Pattern from Format.

Alternatively, you can use Data Validation to actually prevent
("restrict") the use of both cells. For exmample, if only one of A1
and A2 should be non-empty, select A1 and A2, and enter the following
DV for both:

Allow: Custom Formula: =OR(IBLANK($A$1),ISBLANK($A$2))

Customize the Input and Error tabs if you wish.

Mungo wrote:
2. On the subject of conditional formatting, if B2 had
a date in it what would the formula in C2 be for the cell
to turn red after say 100 days from the date in B2?


Cell Value Is: Greater Than: =B2+100