Counting the (1) in a binary number.

serge

Well-known Member
Joined
Oct 8, 2008
Messages
1,402
Office Version
  1. 2007
Platform
  1. Windows
Hi,


I have a this formula in W1465 :

=RIGHT((DEC2BIN((MOD(U1465,4096)/512),3) & DEC2BIN(MOD(U1465,512),9)),7)


Which return the binary string of a number.


I'm looking for a formula in cell AB1465, that will count how many digits (1) are in that string ?


Thank you.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Hello serge

I'm looking for a formula in cell AB1465, that will count how many digits (1) are in that string ?

for that, use this formula
Code:
=LEN(AB1465)-LEN(SUBSTITUTE(AB1465,"1",""))
(y)
 
Upvote 0
Thank you so much r1998, it works perfect, I appreciate it.
Serge.
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,742
Members
448,989
Latest member
mariah3

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