formulas for counting in bases other than 10

youbet7469

New Member
Joined
Mar 20, 2002
Messages
12
Dear group... Can anyone tell me how to program formulas into excel to count in bases other than 10. (i.e. base six would be 1,2,3,4,5,6,11,12,13,14,15,16,21)

Ideally I'd like to be able to work with all the different bases up through 22..

Any advice would be greatly appreciated.

Thanks

Greg
 
wow, this is an old thread, but if you want o know how to count in other bases than 10 without
VBA, number column A 1 through however high you want to count. Call the base b. Then, figure out how many digits you need in your new base, call that n. The fomula to put in B1 is

=mod(int(A1,b^(n-1),b)&mod(int(A1,b^(n-2),b)&mod(int(A1,b^(n-3),b)...... mod(int(A1,b^(1),b)&mod(int(A1,b^(0),b)

This will work for any number base less than 10. Beyond that, you need to start using extra symbols, usually letters, for the digits that represent 10,11,..... So you'll have to use something like a switch function to do that substitution. The math still works, you just don't want to literally concatenate "10" if the math evaluates to 10, you want "a", etc.
Then copy that formula down the B column...
 
Upvote 0

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,215,110
Messages
6,123,146
Members
449,098
Latest member
Doanvanhieu

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top