countif help

tm1974

New Member
Joined
May 27, 2012
Messages
2
is there such a way to write a formula to count the number that are within 10% of a particular number or a number in a cell?

thanks in advance
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
is there such a way to write a formula to count the number that are within 10% of a particular number or a number in a cell?

thanks in advance

Try This


Excel 2007
BCDEFGH
2Number ListNumber Threshold10 % of Number ThresholdUpper limitLower LimitCount or NotCountif
3202022218Yes5
422Yes
523 
628 
718Yes
816 
920Yes
1021Yes
1125 
Sheet1
Cell Formulas
RangeFormula
D3=C3/100*10
E3=C3+D3
F3=C3-D3
G3=IF(AND(B3<=$E$3,B3>=$F$3),"Yes","")
G4=IF(AND(B4<=$E$3,B4>=$F$3),"Yes","")
G5=IF(AND(B5<=$E$3,B5>=$F$3),"Yes","")
G6=IF(AND(B6<=$E$3,B6>=$F$3),"Yes","")
G7=IF(AND(B7<=$E$3,B7>=$F$3),"Yes","")
G8=IF(AND(B8<=$E$3,B8>=$F$3),"Yes","")
G9=IF(AND(B9<=$E$3,B9>=$F$3),"Yes","")
G10=IF(AND(B10<=$E$3,B10>=$F$3),"Yes","")
G11=IF(AND(B11<=$E$3,B11>=$F$3),"Yes","")
H3=COUNTIF(G3:G11,"Yes")


Hopefully it does what you need.
 
Upvote 0
Try:
Sheet1

<table style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; " border="1" cellpadding="0" cellspacing="0"> <colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td>*</td><td>A</td><td>B</td><td>C</td></tr><tr style="height:18px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">2</td><td style="text-align:right; ">5.6</td><td style="text-align:right; ">6</td><td style="text-align:right; ">2</td></tr><tr style="height:18px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">3</td><td style="text-align:right; ">4</td><td>*</td><td>*</td></tr><tr style="height:18px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">4</td><td style="text-align:right; ">5.8</td><td>*</td><td>*</td></tr><tr style="height:18px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">5</td><td style="text-align:right; ">20</td><td>*</td><td>*</td></tr></tbody></table>
<table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tbody><tr><td>Spreadsheet Formulas</td></tr><tr><td><table style="font-family:Arial; font-size:9pt;" border="1" cellpadding="2" cellspacing="0"><tbody><tr style="background-color:#cacaca; font-size:10pt;"><td>Cell</td><td>Formula</td></tr><tr><td>C2</td><td>=SUMPRODUCT(--($A$2:$A$5 <=1.1*B2),--($A$2:$A$5 > =B2*0.9))<b2)< span=""></b2)<></td></tr></tbody></table></td></tr></tbody></table>

To correctly show the formula on this forum had to add spaces before and afte ">","<".
Remove them when copying.

Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited:
Upvote 0
Hi,

Another alternative might be:
Excel Workbook
ABCDE
1List of numbersLookup ValueCount of numbers within 10% of lookup valueExcel 2007+
251033
311
412
510
69
Sheet1
Excel 2010
Cell Formulas
RangeFormula
D2=SUMPRODUCT(--(A2:A6<=1.1*C2),--(A2:A6>=0.9*C2))
E2=COUNTIFS(A2:A6,"<="&1.1*C2,A2:A6,">="&0.9*C2)
 
Upvote 0
Hey guys,

Sorry to hijack the thread but could you explain how SUMPRODUCT works?

Cool responses btw.
 
Upvote 0
Hi,

Another alternative might be:
Excel Workbook
ABCDE
1List of numbersLookup ValueCount of numbers within 10% of lookup valueExcel 2007+
251033
311
412
510
69
Sheet1
Excel 2010
Cell Formulas
RangeFormula
D2=SUMPRODUCT(--(A2:A6<=1.1*C2),--(A2:A6>=0.9*C2))
E2=COUNTIFS(A2:A6,"<="&1.1*C2,A2:A6,">="&0.9*C2)


Thanks for all your responses - worked like a charm
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

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