changing base

Thanks:  0
Likes:  0

1. ## changing base

i am looking to convert base 10 numbers into base 3. i know there are functions to move between 2, 8, 10 and 16 but can excel handle base 3.

2. ## Re: changing base

Isn't it?

=10*INT(A1/3)+MOD(A1,3)

where A1 contains the base 10 number you want to convert.

3. ## Re: changing base

works up to 8, but 9 should be 100 in base 3. your formula returns 30, which is illegal in base 3

4. ## Re: changing base

Originally Posted by lordrom
works up to 8, but 9 should be 100 in base 3. your formula returns 30, which is illegal in base 3

******** ******************** ************************************************************************>
 Microsoft Excel - Book1 ___Running: xl2002 XP : OS = Windows XP
 File Edit View Insert Options Tools Data Window Help About
 A1 =

A
B
C
D
1
1009
 Sheet1

[HtmlMaker light Ver1.10] To see the formula in the cells just click on the cells hyperlink or click the Name box
PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.

5. ## Re: changing base

exactly what i'm after

cheers

now, where do i find morefunc? i trust it will cost?

6. ## Re: changing base

Originally Posted by lordrom
exactly what i'm after

cheers

now, where do i find morefunc? i trust it will cost?

http://216.92.17.166/board2/viewtopic.php?t=49750

7. ## Re: changing base

Originally Posted by lordrom
works up to 8, but 9 should be 100 in base 3. your formula returns 30, which is illegal in base 3
I'd better go back to school!

8. ## Re: changing base

Originally Posted by Andrew Poulsom
Originally Posted by lordrom
works up to 8, but 9 should be 100 in base 3. your formula returns 30, which is illegal in base 3
I'd better go back to school!
Andrew,

What would be the Excel functions to convert?

9. ## Re: changing base

That's the problem. It involves iteration so I don't think it can be done with standard Excel funtions. Here is a UDF I found:

Code:
```Function baseconv(InputNum, BaseNum)
Dim quotient, remainder As Single

quotient = InputNum   ' Set quotient to number to convert.
remainder = InputNum  ' Set remainder to number to convert.

Do While quotient <> 0   ' Loop while quotient is not zero.

' Store the remainder of the quotient divided by base number in a
' variable called remainder.

remainder = quotient Mod BaseNum

' Reset quotient variable to the integer value of the quotient
' divided by base number.

quotient = Int(quotient / BaseNum)

' Convert answer variable to a number.
Loop
End Function```

## User Tag List

#### Posting Permissions

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