2

According to the relevant Microsoft Support page on the BITAND function, I should have access to it, as I am running Excel for Mac 2011 (with the latest updates installed):

"APPLIES TO: Excel 2016, Excel 2013, Excel 2016 for Mac, Excel for Mac 2011",

When when I try to use it, e.g. by entering "=BITAND(127,8)" I get the dreaded "#NAME?", showing that it is not in fact recognized. It does not appear as an auto-complete option while typing, in fact entering just "=BIT" generates no autocomplete suggestions.

The Microsoft Support page doesn't say anything about needing to install additional add-in packages, although I know that's sometimes an issue. (Note: apparently it was required in 2008 as this link suggests, but nothing for the 2011 version.)

Can anyone offer a suggestion to get this working?

Alternatively, I just want to obtain a decimal-to-binary conversion but unlike DEC2BIN I don't want a string of 1's and 0's in the same cell, rather I want each bit value to end up in its own cell. Perhaps parsing the DEC2BIN string would get the job done.

Thanks.

D Schlachter
  • 2,058
sh37211
  • 134
  • 8

1 Answers1

1

VBA includes operators AND and OR, so you can create user-defined functions as follows:

Function Band(arg1, arg2)
    Band = arg1 And arg2
End Function

Function Bor(arg1, arg2)
    Bor = arg1 Or arg2
End Function

You can then call these, e.g., =Band(127,8), from cells.

See How do I add VBA in MS Office? for general information.