Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Binary NOT?

Hi

I have successfully created functions for bitwise operators BInary AND, OR
and XOR using the following format in VBA (2010 beta)

Function Bin<operator(a, b)
Bin<operator = a <operator b
End Function

for example the XOR script is:

Function BinXor(a, b)
BinXor = a Xor b
End Function

when I try the same for NOT, VBA comes back with:

Function BinNot(a)
BinNot = Not a
End Function

which is fine as you can only NOT 1 number

The answers are not what I am expecting however, ie the corret outputs are
0=1 and 1=0 whereas the functions output is: 1= -2 and 0 = -1

What do I need to do to make this work or is there a built in "binary flip"
function in Excel?

Regards

Mark


 
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
binary format John Excel Discussion (Misc queries) 2 April 26th 08 01:09 AM
decimal to binary boardmaker Excel Discussion (Misc queries) 4 June 13th 06 09:00 PM
Hexadecimal to binary [email protected] Excel Discussion (Misc queries) 5 March 4th 06 05:45 PM
Binary bit analysis MadManInABox Excel Discussion (Misc queries) 5 September 9th 05 09:08 PM
Solver returns non binary answer in binary constrained cells Navy Student Excel Worksheet Functions 6 September 1st 05 03:11 PM


All times are GMT +1. The time now is 08:11 PM.

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"