Count 1 & sum in number series

skr971

New Member
Joined
Mar 19, 2014
Messages
31
Hi All,

i need a formula for count 1 in number series like :

Column A
1121Ans . 8
21
11
1431

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>

i need a formula which is sum 1 in given number series

thanks in advannce
 

Some videos you may like

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,382
Office Version
  1. 2013
Platform
  1. Windows
Try

<b>Excel 2010</b><table cellpadding="2.5px" rules="all" style=";background-color: #FFFFFF;border: 1px solid;border-collapse: collapse; border-color: #BBB"><colgroup><col width="25px" style="background-color: #DAE7F5" /><col /><col /></colgroup><thead><tr style=" background-color: #DAE7F5;text-align: center;color: #161120"><th></th><th>A</th><th>B</th></tr></thead><tbody><tr ><td style="color: #161120;text-align: center;">1</td><td style="border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;;">Column A</td><td style="text-align: right;border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;;"></td></tr><tr ><td style="color: #161120;text-align: center;">2</td><td style="text-align: right;border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;;">1121</td><td style="text-align: right;border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;;">3</td></tr><tr ><td style="color: #161120;text-align: center;">3</td><td style="text-align: right;border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;;">21</td><td style="text-align: right;border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;;">1</td></tr><tr ><td style="color: #161120;text-align: center;">4</td><td style="text-align: right;border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;;">11</td><td style="text-align: right;border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;;">2</td></tr><tr ><td style="color: #161120;text-align: center;">5</td><td style="text-align: right;border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;;">1431</td><td style="text-align: right;border-top: 1px solid black;border-right: 1px solid black;border-bottom: 1px solid black;border-left: 1px solid black;;">2</td></tr></tbody></table><p style="width:3.6em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid #BBB;border-top:none;text-align: center;background-color: #DAE7F5;color: #161120">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: #FFFFFF" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: #FFFFFF;border-collapse: collapse; border-color: #BBB"><thead><tr style=" background-color: #DAE7F5;color: #161120"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">B2</th><td style="text-align:left">=LEN(<font color="Blue">A2</font>)-LEN(<font color="Blue">SUBSTITUTE(<font color="Red">A2,1,""</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">B3</th><td style="text-align:left">=LEN(<font color="Blue">A3</font>)-LEN(<font color="Blue">SUBSTITUTE(<font color="Red">A3,1,""</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">B4</th><td style="text-align:left">=LEN(<font color="Blue">A4</font>)-LEN(<font color="Blue">SUBSTITUTE(<font color="Red">A4,1,""</font>)</font>)</td></tr><tr><th width="10px" style=" background-color: #DAE7F5;color: #161120">B5</th><td style="text-align:left">=LEN(<font color="Blue">A5</font>)-LEN(<font color="Blue">SUBSTITUTE(<font color="Red">A5,1,""</font>)</font>)</td></tr></tbody></table></td></tr></table><br />
 

Teeroy

Well-known Member
Joined
Nov 9, 2012
Messages
2,240
Try

Excel 2010
AB
1Column A
211213
3211
4112
514312

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
B2=LEN(A2)-LEN(SUBSTITUTE(A2,1,""))
B3=LEN(A3)-LEN(SUBSTITUTE(A3,1,""))
B4=LEN(A4)-LEN(SUBSTITUTE(A4,1,""))
B5=LEN(A5)-LEN(SUBSTITUTE(A5,1,""))

<tbody>
</tbody>

<tbody>
</tbody>

Nice idea Michael. You could extend it to a single array formula with

=SUM(LEN(A2:A6))-SUM(LEN(SUBSTITUTE(A2:A6,1,"")))

@skr971, confirm with CTRL + Shift + Enter (NOT just Enter)
 

skr971

New Member
Joined
Mar 19, 2014
Messages
31
Thanks Michael for your suport but i need total sum(like answer 8) not every cell result
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,382
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

@Teeroy
Nice back at ya'....:biggrin:...I didn't read the SUM bit....:oops:
 

skr971

New Member
Joined
Mar 19, 2014
Messages
31
Hi Teeroy,

=SUM(LEN(A2:A6))-SUM(LEN(SUBSTITUTE(A2:A6,1,"")))

it's not working, i need sum of number 1(answer 8)
 

azumi

Well-known Member
Joined
Jun 4, 2013
Messages
555

ADVERTISEMENT

=SUM(LEN(A2:A5)-LEN(SUBSTITUTE(A2:A5,1,"")))

Array Formula, when ENTER you need to press CTRl-SHIFT-ENTER button together

Thanks
 

Michael M

Well-known Member
Joined
Oct 27, 2005
Messages
19,382
Office Version
  1. 2013
Platform
  1. Windows
Did you enter it with CTRL + SHIFT + ENTER......not just Enter !!
 

Watch MrExcel Video

Forum statistics

Threads
1,112,821
Messages
5,542,690
Members
410,568
Latest member
jmagasan
Top