Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Kaleem Habib
 
Posts: n/a
Default Conversion of Dec numbers to Bin, Oct and Hex and visa versa

I'm attempting to produce an excel spreadsheet that can convert decimal
numbers (up to any value) to binary, octal and hexadecimal. Conversely I'm
also trying to produce an excel spreadsheet that can convert Hex values to
binary, octal and decimal. I need to create this spreadsheet without the use
of the dec2hex, dec2bin etc excel functions. Basically the spreadsheet needs
to be able to replicate the results of these excel functions without
actually using them. The solution has to be contained within the
spreadsheets. I can't use the VB module within Excel to derive the solution.

Thanks for your help

Regards....Kaleem


  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

Withoiut the ATP, without VBA. I think you are going to be struggling to
handle any value.

--
HTH

Bob Phillips

"Kaleem Habib" wrote in message
...
I'm attempting to produce an excel spreadsheet that can convert decimal
numbers (up to any value) to binary, octal and hexadecimal. Conversely I'm
also trying to produce an excel spreadsheet that can convert Hex values to
binary, octal and decimal. I need to create this spreadsheet without the

use
of the dec2hex, dec2bin etc excel functions. Basically the spreadsheet

needs
to be able to replicate the results of these excel functions without
actually using them. The solution has to be contained within the
spreadsheets. I can't use the VB module within Excel to derive the

solution.

Thanks for your help

Regards....Kaleem




  #3   Report Post  
ivano
 
Posts: n/a
Default


"Kaleem Habib" ha scritto nel messaggio
...
I'm attempting to produce an excel spreadsheet that can convert decimal
numbers (up to any value) to binary, octal and hexadecimal. Conversely I'm
also trying to produce an excel spreadsheet that can convert Hex values to
binary, octal and decimal. I need to create this spreadsheet without the

use
of the dec2hex, dec2bin etc excel functions. Basically the spreadsheet

needs
to be able to replicate the results of these excel functions without
actually using them. The solution has to be contained within the
spreadsheets. I can't use the VB module within Excel to derive the

solution.

Thanks for your help

Regards....Kaleem



Hy Kaleem,
for decimal to binary you can use:
=SUM(((0&REPT("8",ROW(INDIRECT("1:"&INT(LOG(A1,2)+ 1)))-1))+1)*ROUND($H$1/(2^
ROW(INDIRECT("1:"&INT(LOG(A1,2)+1)))),0))

for decimal to other, i don't know now.

for binary to decimal:
=SUM(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)*2^(LEN( A1)-ROW(INDIRECT("1:"&LEN(
A1)))))

for octal to decimal:
=SUM(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)*8^(LEN( A1)-ROW(INDIRECT("1:"&LEN(
A1)))))

for hexadecimal to decimal:
=SUM((SEARCH(MID(A3,ROW(INDIRECT("1:"&LEN(A3))),1) ,"0123456789ABCDEF")-1)*16
^(LEN(A3)-ROW(INDIRECT("1:"&LEN(A3)))))

all are array formula, ctr+shift+enter

see also:
http://groups.google.it/group/micros...30a740447345c8

ivano


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



All times are GMT +1. The time now is 11:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"