If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > colums to rows

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-26-04, 05:01
ISLMAN1975 ISLMAN1975 is offline
Registered User
 
Join Date: Mar 2004
Posts: 69
2's complement

I've got a excel file which has three rows the first being the heading for each colum and the other two are my data recipe 1 & recipe 2. I have over 100 colums of ingredients for the recipes. All i want to do is turn the spread sheet 90 degrees so that I then have three colums and all my ingredients are in the row's so I can print the ting out beter. I'm not sure what the correct term is for this procedure so I havent had any luck in help menu.

Last edited by ISLMAN1975; 11-26-04 at 08:00.
Reply With Quote
  #2 (permalink)  
Old 11-26-04, 05:33
cdistefano cdistefano is offline
Registered User
 
Join Date: Nov 2004
Posts: 13
The term is "Transpose".
You would need to copy and paste your entire range including column headers. But to paste you must first right click to activate Excel's short menu. Then select "Paste Special" and click "Transpose". Hope this helps.
Reply With Quote
  #3 (permalink)  
Old 11-26-04, 07:43
ISLMAN1975 ISLMAN1975 is offline
Registered User
 
Join Date: Mar 2004
Posts: 69
Simple when you know how. Thanks thats worked a treat.

Here's another one for anybody is there a function to find the 2's complement of a number. I've tried inverting it using NOT and then I was going to add 1 but the NOT expression just returns true or false I want it to invert all the bit and give me a decimal value.

Quote:
Originally Posted by cdistefano
The term is "Transpose".
You would need to copy and paste your entire range including column headers. But to paste you must first right click to activate Excel's short menu. Then select "Paste Special" and click "Transpose". Hope this helps.
Reply With Quote
  #4 (permalink)  
Old 11-26-04, 08:08
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
can you let me know what the 2's complement is and ill try and help you out

Dave
Reply With Quote
  #5 (permalink)  
Old 11-26-04, 08:22
ISLMAN1975 ISLMAN1975 is offline
Registered User
 
Join Date: Mar 2004
Posts: 69
375321.7208
Reply With Quote
  #6 (permalink)  
Old 11-26-04, 08:30
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
erm okay im none the wiser, is there a logical process to go through to obtain the 2's complement,

i.e. 1/X + 1 where X <> 0 etc.

Dave
Reply With Quote
  #7 (permalink)  
Old 11-26-04, 09:20
ISLMAN1975 ISLMAN1975 is offline
Registered User
 
Join Date: Mar 2004
Posts: 69
I want the 2'complement of this number 375322
Reply With Quote
  #8 (permalink)  
Old 11-26-04, 10:10
DavidCoutts DavidCoutts is offline
Registered User
 
Join Date: Jan 2004
Location: Aberdeen, Scotland
Posts: 1,067
Ok ive written a function for you this only returns the value of the 2's Comlement as a string, the function reads in binary and outputs a string in binary format


Code:
Function TwosComplement(ByVal rngNum As Range) As String
'written by David Coutts
'26/11/2004
    
    Dim outVal As String
    Dim i As Integer, lenOrig As Integer
    Dim myNum As Long
    
    
    'Invert the Binary
    For i = 1 To Len(rngNum.Value)
        outVal = outVal & Abs((CInt(Mid(rngNum.Value, i, 1)) - 1) Mod 2)
    Next i
    
    Dim bolDone As Boolean
    'convert from binary to integer
    For i = Len(outVal) To 1 Step -1
        myNum = myNum + CInt(Mid(outVal, i, 1)) * 2 ^ (Len(outVal) - i)
    Next i
    myNum = myNum + 1
        
    'convert back to binary
    For i = Len(outVal) - 1 To 0 Step -1
        If myNum - (2 ^ i) >= 0 Then
            myNum = myNum - (2 ^ i)
            TwosComplement = TwosComplement & "1"
        Else
            TwosComplement = TwosComplement & "0"
        End If
    Next i

End Function
Dave

Last edited by DavidCoutts; 11-26-04 at 10:23.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On