View Single Post
  #8  
Old June 6th, 2010, 12:05 PM posted to microsoft.public.excel.misc
Stan Brown
external usenet poster
 
Posts: 536
Default Nested AND OR expressions

On Sat, 5 Jun 2010 19:44:24 +0100, Colin Hayes wrote:

HI

I need to express something in VBA , and am having trouble with it.

I need to say this :

IF E1 CONTAINS "1bx" OR "2bx" OR "3bx" AND J1 =11 THEN PUT 1 , OTHERWISE
PUT J1

Can someone assist with some code to make this happen , please?

Grateful for any help.


The most straightforward way, I think, is

=IF( AND( OR(E1="1bx",E1="2bx","E1="3bx"), J1=11), 1, J1)


--
Stan Brown, Oak Road Systems, Tompkins County, New York, USA
http://OakRoadSystems.com
Shikata ga nai...