View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove Harlan Grove is offline
external usenet poster
 
Posts: 733
Default Hexidecimal lookup

Dana DeLouis wrote...
....
I would use a custom function, something like the following.
Those values that return 1 are associated with what you are looking for.

Function BitAnd(n1, n2)
BitAnd = Sgn(n1 And n2)
End Function

....

Unnecessary. If you want to mask bits, you could use built-in
functions.

=MOD(INT(h,p),2)

returns 1 if the binary representation of h (a [decimal] number) has
the (log(p,2)-1)th bit set. Alternatively, rewrite this as

=MOD(INT(h,2^n),2)

where n = 0 to 19 to span the OP's table. When VBA is easily avoidable,
it should be avoided.