im trying to use a countif but its returning the wrong count

Reecenorman1996

New Member
Joined
Jul 20, 2023
Messages
31
Office Version
  1. 365
Platform
  1. Windows
i have a column in a table which is using a formula to calculate a percentage , i used this formula =COUNTIF(Table1[%],"<5%") but it returned the wrong number and i have no idea why
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Can you post some sample data that shows the problem.
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Can you post some sample data that shows the problem.
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
i downloaded but its greyed out
1691409393919.png
 
Upvote 0
PR 07-08-2023.xlsx
FGHIJKLM
1Old PriceReduction%new pricePortal bandings
2£9,000,000£8,000,00089%£1,000,000£260,000Total PR
3£110,000£30,00027%£80,000£270,000
4£350,000£75,00021%£275,000£280,000
5£150,000£30,00020%£120,000£290,000
6£10,000£2,00020%£8,000£300,000
7£10,000£2,00020%£8,000£325,000Count if under 5%
8£10,000£2,00020%£8,000£350,00054
9£110,000£20,00018%£90,000£375,000
10£600,000£100,00017%£500,000£400,000
11£415,000£65,00016%£350,000£425,000
12£350,000£50,00014%£300,000£450,000
13£120,000£16,00013%£104,000£475,000
14£275,000£35,00013%£240,000£500,000
15£325,000£40,00012%£285,000£550,000
16£325,000£40,00012%£285,000£600,000
17£1,250,000£150,00012%£1,100,000£650,000
18£85,000£10,00012%£75,000£700,000
19£190,000£20,00011%£170,000£800,000
20£100,000£10,00010%£90,000£900,000
21£100,000£10,00010%£90,000£1,000,000
22£415,000£40,00010%£375,000£1,250,000
23£210,000£20,00010%£190,000£1,500,000
24£1,100,000£100,0009%£1,000,000£1,750,000
25£1,100,000£100,0009%£1,000,000£2,000,000
26£550,000£50,0009%£500,000£2,500,000
27£550,000£50,0009%£500,000£3,000,000
28£550,000£50,0009%£500,000£4,000,000
29£220,000£20,0009%£200,000£5,000,000
30£220,000£20,0009%£200,000£7,500,000
31£220,000£20,0009%£200,000
32£875,000£75,0009%£800,000
33£435,000£35,0008%£400,000
34£250,000£20,0008%£230,000
35£650,000£50,0008%£600,000
36£650,000£50,0008%£600,000
37£325,000£25,0008%£300,000
38£325,000£25,0008%£300,000
39£325,000£25,0008%£300,000
40£325,000£25,0008%£300,000
41£325,000£25,0008%£300,000
42£325,000£25,0008%£300,000
43£325,000£25,0008%£300,000
44£325,000£25,0008%£300,000
45£325,000£25,0008%£300,000
46£292,000£22,0008%£270,000
47£700,000£50,0007%£650,000
48£700,000£50,0007%£650,000
49£350,000£25,0007%£325,000
50£350,000£25,0007%£325,000
51£350,000£25,0007%£325,000
52£350,000£25,0007%£325,000
53£140,000£10,0007%£130,000
54£725,000£50,0007%£675,000
55£290,000£20,0007%£270,000
56£1,495,000£100,0007%£1,395,000
57£750,000£50,0007%£700,000
58£750,000£50,0007%£700,000
59£750,000£50,0007%£700,000
60£750,000£50,0007%£700,000
61£375,000£25,0007%£350,000
62£375,000£25,0007%£350,000
63£375,000£25,0007%£350,000
64£300,000£20,0007%£280,000
65£150,000£10,0007%£140,000
66£800,000£50,0006%£750,000
67£800,000£50,0006%£750,000
68£800,000£50,0006%£750,000
69£400,000£25,0006%£375,000
70£400,000£25,0006%£375,000
71£400,000£25,0006%£375,000
72£400,000£25,0006%£375,000
73£400,000£25,0006%£375,000
74£400,000£25,0006%£375,000
75£400,000£25,0006%£375,000
76£240,000£15,0006%£225,000
77£160,000£10,0006%£150,000
78£399,950£24,9506%£375,000
79£165,000£10,0006%£155,000
80£850,000£50,0006%£800,000
81£425,000£25,0006%£400,000
82£425,000£25,0006%£400,000
83£425,000£25,0006%£400,000
84£425,000£25,0006%£400,000
85£425,000£25,0006%£400,000
86£170,000£10,0006%£160,000
87£170,000£10,0006%£160,000
88£690,000£40,0006%£650,000
89£350,000£20,0006%£330,000
90£530,000£30,0006%£500,000
91£450,000£25,0006%£425,000
92£550,000£30,0005%£520,000
93£550,000£30,0005%£520,000
94£275,000£15,0005%£260,000
95£370,000£20,0005%£350,000
96£950,000£50,0005%£900,000
97£475,000£25,0005%£450,000
98£475,000£25,0005%£450,000
99£475,000£25,0005%£450,000
100£475,000£25,0005%£450,000
101£190,000£10,0005%£180,000
102£1,250,000£65,0005%£1,185,000
103£600,000£30,0005%£570,000
104£500,000£25,0005%£475,000
105£500,000£25,0005%£475,000
106£300,000£15,0005%£285,000
107£220,000£11,0005%£209,000
108£200,000£10,0005%£190,000
109£200,000£10,0005%£190,000
110£200,000£10,0005%£190,000
111£200,000£10,0005%£190,000
112£525,000£25,0005%£500,000
113£525,000£25,0005%£500,000
114£315,000£15,0005%£300,000
115£210,000£10,0005%£200,000
116£210,000£10,0005%£200,000
117£210,000£10,0005%£200,000
118£210,000£10,0005%£200,000
119£550,000£25,0005%£525,000
120£550,000£25,0005%£525,000
121£220,000£10,0005%£210,000
122£220,000£10,0005%£210,000
123£445,000£20,0004%£425,000
124£450,000£20,0004%£430,000
125£230,000£10,0004%£220,000
126£575,000£25,0004%£550,000
127£230,000£10,0004%£220,000
128£600,000£25,0004%£575,000
129£600,000£25,0004%£575,000
130£625,000£25,0004%£600,000
131£625,000£25,0004%£600,000
132£625,000£25,0004%£600,000
133£650,000£25,0004%£625,000
134£650,000£25,0004%£625,000
135£280,000£10,0004%£270,000
136£280,000£10,0004%£270,000
137£280,000£10,0004%£270,000
138£280,000£10,0004%£270,000
139£280,000£10,0004%£270,000
140£280,000£10,0004%£270,000
141£285,000£10,0004%£275,000
142£290,000£10,0003%£280,000
143£290,000£10,0003%£280,000
144£595,000£20,0003%£575,000
145£750,000£25,0003%£725,000
146£300,000£10,0003%£290,000
147£160,000£5,0003%£155,000
148£650,000£20,0003%£630,000
149£325,000£10,0003%£315,000
150£500,000£15,0003%£485,000
151£500,000£15,0003%£485,000
152£350,000£10,0003%£340,000
153£540,000£15,0003%£525,000
154£360,000£10,0003%£350,000
155£241,500£6,5003%£235,000
156£385,000£10,0003%£375,000
157£215,000£5,0002%£210,000
158£435,000£10,0002%£425,000
159£220,000£5,0002%£215,000
160£700,000£15,0002%£685,000
161£240,000£5,0002%£235,000
162£249,995£5,0002%£244,995
163£800,000£15,0002%£785,000
164£650,000£10,0002%£640,000
165£415,000£5,0001%£410,000
Report
Cell Formulas
RangeFormula
H2:H165H2=SUM(G2/F2)
I2:I165I2=[@[Old Price]]-[@Reduction]
M8M8=COUNTIF(Table1[%],"<5%")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
I1:I165,G166:G1048576Cell Value=7500000textNO
I1:I165,G166:G1048576Cell Value=5000000textNO
I1:I165,G166:G1048576Cell Value=4000000textNO
I1:I165,G166:G1048576Cell Value=3000000textNO
I1:I165,G166:G1048576Cell Value=2500000textNO
I1:I165,G166:G1048576Cell Value=2000000textNO
I1:I165,G166:G1048576Cell Value=1750000textNO
I1:I165,G166:G1048576Cell Value=1500000textNO
I1:I165,G166:G1048576Cell Value=1250000textNO
I1:I165,G166:G1048576Cell Value=1000000textNO
I1:I165,G166:G1048576Cell Value=900000textNO
I1:I165,G166:G1048576Cell Value=800000textNO
I1:I165,G166:G1048576Cell Value=700000textNO
I1:I165,G166:G1048576Cell Value=650000textNO
I1:I165,G166:G1048576Cell Value=600000textNO
I1:I165,G166:G1048576Cell Value=550000textNO
I1:I165,G166:G1048576Cell Value=500000textNO
I1:I165,G166:G1048576Cell Value=475000textNO
I1:I165,G166:G1048576Cell Value=450000textNO
I1:I165,G166:G1048576Cell Value=425000textNO
I1:I165,G166:G1048576Cell Value=400000textNO
I1:I165,G166:G1048576Cell Value=375000textNO
I1:I165,G166:G1048576Cell Value=350000textNO
I1:I165,G166:G1048576Cell Value=325000textNO
I1:I165,G166:G1048576Cell Value=300000textNO
I1:I165,G166:G1048576Cell Value=290000textNO
I1:I165,G166:G1048576Cell Value=280000textNO
I1:I165,G166:G1048576Cell Value=270000textNO
I1:I165,G166:G1048576Cell Value=260000textNO
I2:I165Expression=$G:$G=$K$2:$K$30textNO
 
Upvote 0
Thanks for that.
In what way do you think it's not working? There are 54 values below 5% which is what the formula returns.
 
Upvote 0
If you expand the % column to show 2 decimal places you will see that everything from row 112 downwards is <5%
 
Upvote 1
Solution

Forum statistics

Threads
1,223,911
Messages
6,175,331
Members
452,636
Latest member
laura12345

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