#1   Report Post  
Posted to microsoft.public.excel.misc
boardmaker
 
Posts: n/a
Default binary inverse


To make my life a little easier is there any way to get a binary number
to inverse. Example. 1110 in a1 so then b1 would become 0001.


--
boardmaker
------------------------------------------------------------------------
boardmaker's Profile: http://www.excelforum.com/member.php...o&userid=34854
View this thread: http://www.excelforum.com/showthread...hreadid=551647

  #2   Report Post  
Posted to microsoft.public.excel.misc
mooncrawler
 
Posts: n/a
Default binary inverse

Public Function binverse(wCell As String) As String
Dim x, y As Integer
Dim nResult As String
nResult = vbNullString
x = Len(wCell)
For y = 1 To x
If Mid(wCell, y, 1) = "1" Then
nResult = nResult & "0"
Else
nResult = nResult & "1"
End If
Next
binverse = nResult
End Function




"boardmaker"
schreef in bericht
...

To make my life a little easier is there any way to get a binary number
to inverse. Example. 1110 in a1 so then b1 would become 0001.


--
boardmaker
------------------------------------------------------------------------
boardmaker's Profile:
http://www.excelforum.com/member.php...o&userid=34854
View this thread: http://www.excelforum.com/showthread...hreadid=551647



  #3   Report Post  
Posted to microsoft.public.excel.misc
David Biddulph
 
Posts: n/a
Default binary inverse

"boardmaker" wrote
in message ...

To make my life a little easier is there any way to get a binary number
to inverse. Example. 1110 in a1 so then b1 would become 0001.


One way would be =DEC2BIN(2^(LEN(A1))-1-BIN2DEC(A1),LEN(A1))
--
David Biddulph


  #4   Report Post  
Posted to microsoft.public.excel.misc
 
Posts: n/a
Default binary inverse

boardmaker wrote:
To make my life a little easier is there any way to get a binary number
to inverse. Example. 1110 in a1 so then b1 would become 0001.


I presume you mean one's complement, not inverse. And 0001 is the
complement of 1110 only in a 4-bit world.

The one's complement of a 4-bit binary number (in A1) can be computed
by:

=dec2bin(16 - bin2dec(A1) - 1, 4)

  #5   Report Post  
Posted to microsoft.public.excel.misc
daddylonglegs
 
Posts: n/a
Default binary inverse


Here's one way

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,1,2),0,1),2,0 )


--
daddylonglegs
------------------------------------------------------------------------
daddylonglegs's Profile: http://www.excelforum.com/member.php...o&userid=30486
View this thread: http://www.excelforum.com/showthread...hreadid=551647



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
Recognition of Binary Prefix Numerical Format Dogbert Excel Discussion (Misc queries) 4 June 14th 06 06:19 PM
Is there a way to count higher than 511 in binary in excel? havocdragon Excel Worksheet Functions 1 October 15th 05 05:14 AM
Solver returns non binary answer in binary constrained cells Navy Student Excel Worksheet Functions 6 September 1st 05 03:11 PM
binary bit word Don Excel Worksheet Functions 2 August 20th 05 02:54 PM
Binary Numbers longer than 10 characters Andibevan Excel Worksheet Functions 2 April 6th 05 10:08 PM


All times are GMT +1. The time now is 06:46 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"