This is probably overkill, but if you are willing to use a UDF (user defined function) created in VBA code, then here is a function (with two supporting functions that it needs to make use of) that will handle up to 95 bit addition or subtraction. The function is named BinAddSub. Note that the binary numbers on the worksheet should be placed in cell formatted as Text. To use the function just pass it the main binary number and the binary number you want to add or subtract from it. If you are adding, you do not have to specify the optional third argument because addition is the default action (you can supply a quoted plus sign for the third argument if you wish); however if you are doing a subtraction, you must tell the function that by providing a quoted minus sign as the third argument. You should format the cell you put the formula using this UDF in as Text to preserve leading zeroes. Also, the function returns as many bits as there are in the first argument. Here is the code...
HOW TO INSTALL UDFs
------------------------------------
If you are new to UDFs, they are easy to install and use. To install it, simply press ALT+F11 to go into the VB editor and, once there, click Insert/Module on its menu bar, then copy/paste all of the above code into the code window that just opened up. That's it.... you are done. You can now use NameOfTheUDF just like it was a built-in Excel function. For example,
=BinAddSub(A1,A2)
=BinAddSub(A1,A2,"+")
=BinAddSub(A1,A2,"-")
If you are using XL2007 or above, make sure you save your file as an "Excel Macro-Enabled Workbook (*.xlsm) and answer the "do you want to enable macros" question as "yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.
Bookmarks