+ Reply to Thread
Results 1 to 8 of 8

Binary to Decimal

Hybrid View

  1. #1
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Binary to Decimal

    If the binary strings are always 32 characters (i.e., leading zeros as needed), then

    A
    B
    2
    01111110001111010000011101010001
    2117928785
    3
    11001111111111110101111011001010
    3489619658
    4
    10010100101100000110101100101111
    2494589743
    5
    00110101010000101000011110110010
    893552562
    6
    10100011010110100110000101110000
    2740609392
    7
    11100001100101100010000111011111
    3784712671
    8
    01110100011011101100111101010011
    1953419091
    9
    00101011111000101101010101000010
    736286018
    10
    11111110111101100100000111001001
    4277551561
    11
    01111011000110101111110010101111
    2065366191
    12
    01100010100100110110011010111011
    1653827259


    The formula in B1 is

    =SUMPRODUCT(MID(A2, {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32}, 1)
    * 2^{31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0})

    If they vary in length,

    A
    B
    2
    11100100101
    1829
    3
    110100000100110
    26662
    4
    100001101111000010001
    1105425
    5
    111011011001110111010110
    15572438
    6
    1001011110100000010110100
    19873972
    7
    1101111110000
    7152


    =SUMPRODUCT(MID(RIGHT(REPT(0,31) & A2, 32),
    {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32}, 1) *
    2^{31,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0})
    Last edited by shg; 11-09-2017 at 12:37 PM.
    Entia non sunt multiplicanda sine necessitate

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Binary to decimal converter
    By SavageMind in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-15-2016, 05:12 PM
  2. [SOLVED] Signed Binary Decimal (B16) Conversion
    By Talamon in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-15-2014, 03:34 PM
  3. Excel Binary to Decimal
    By madushana in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-19-2013, 01:00 PM
  4. Binary to Decimal converter
    By thedudester1978 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-13-2012, 12:42 PM
  5. Converts a decimal number to binary
    By sricomm in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 10-09-2006, 10:37 PM
  6. decimal to binary
    By boardmaker in forum Excel General
    Replies: 4
    Last Post: 06-13-2006, 04:10 PM
  7. [SOLVED] decimal to binary conversion
    By tam in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-29-2005, 01:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1