#1   Report Post  
Howard
 
Posts: n/a
Default Boolean masks

I want to use boolean masking eg 10011 AND 01011 should return 00011 but I
just keep getting TRUE or FALSE from the AND operator. Is there something
I'm missing or can EXCEL not do this?

Thanks for any help
  #2   Report Post  
Fredrik Wahlgren
 
Posts: n/a
Default


"Howard" wrote in message
...
I want to use boolean masking eg 10011 AND 01011 should return 00011 but I
just keep getting TRUE or FALSE from the AND operator. Is there something
I'm missing or can EXCEL not do this?

Thanks for any help


Not directly. You need to make a User Defined Function. Here's some VB6 code
that you can use.
http://www.devx.com/vb2themax/Tip/19306

/Fredrik



  #3   Report Post  
Chip Pearson
 
Posts: n/a
Default

Howard,

VBA supports bitwise AND (and ORs). For example,

Dim X As Integer
Dim Y As Integer
Dim Z As Integer
X = 19 '10011
Y = 11 '01011
Z = X And Y ' Z = 3
Debug.Print Z


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com

"Howard" wrote in message
...
I want to use boolean masking eg 10011 AND 01011 should return
00011 but I
just keep getting TRUE or FALSE from the AND operator. Is
there something
I'm missing or can EXCEL not do this?

Thanks for any help



Reply
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
Formula to list unique values JaneC Excel Worksheet Functions 4 December 10th 04 12:25 AM
boolean find criteria in Excel davista00 Excel Discussion (Misc queries) 1 December 1st 04 03:45 PM


All times are GMT +1. The time now is 07:09 PM.

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

About Us

"It's about Microsoft Excel"