LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 524
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...
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get rid of with regular expressions Howdy Excel Discussion (Misc queries) 1 January 18th 10 07:42 PM
Regular expressions in VB FiluDlidu Excel Discussion (Misc queries) 4 March 21st 08 01:10 AM
excel asp and expressions web Healing Excel Discussion (Misc queries) 0 December 7th 07 05:11 PM
Regular Expressions & Middle Name [email protected] Excel Worksheet Functions 7 July 22nd 07 01:58 AM
Regular expressions in Excel vigi98 Excel Discussion (Misc queries) 3 November 10th 05 04:40 PM


All times are GMT +1. The time now is 09:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright 2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"