Countif used in table

APML

Board Regular
Joined
Sep 10, 2021
Messages
216
Office Version
  1. 365
Hi all, I'm trying to use countif in a table:

=COUNTIF(Table20[HIGH],B6)

where B6 is a separate cell (not in the table). I'm trying to count how many times the value entered in B6 (let's say .03) appears in the column in the table.
, but I'm obviously doing something wrong. Would appreciate help
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Your formula is OK. I'm sure the problem is in your data. What exactly is in column HIGH? If you have a value in column HIGH, for example, 0.0312345 it will display as 0.03 but will not be counted if you have 0.03 in B6. It's not exactly 0.03.

Also sometimes real numbers that look like they should match don't. It is very unreliable to do exact matches on real numbers on a computer. Generally you should be rounding results before you try to test for equality, or test for falling within a range.

Can you describe your data in more detail, maybe explain what is in column HIGH? Are these formulas or values? Can you give examples?
 
Upvote 0
Your formula is OK. I'm sure the problem is in your data. What exactly is in column HIGH? If you have a value in column HIGH, for example, 0.0312345 it will display as 0.03 but will not be counted if you have 0.03 in B6. It's not exactly 0.03.

Also sometimes real numbers that look like they should match don't. It is very unreliable to do exact matches on real numbers on a computer. Generally you should be rounding results before you try to test for equality, or test for falling within a range.

Can you describe your data in more detail, maybe explain what is in column HIGH? Are these formulas or values? Can you give examples?
Hi thanks for your help, the column in the table contains numbers to 4 decimal places, and the cell I'm comparing it to also contains a number to 4 decimal places, so they are the same and formatted the same, that's why I'm confused
 
Upvote 0
Are the numbers you are comparing the result of formulas?
Do the numbers actually have 4 decimal places, or are you just displaying 4 decimal places?

As I asked, can you provide examples?

I am still 99% sure that the issue is your data.
 
Upvote 0
Are the numbers you are comparing the result of formulas?
Do the numbers actually have 4 decimal places, or are you just displaying 4 decimal places?

As I asked, can you provide examples?

I am still 99% sure that the issue is your data.
Hi, really appreciate your help...After some internet searching i found this:

=COUNTIF(G9:G907,"="&$B$6)

So I've replaced the table column with cell addresses and it now it works.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,651
Messages
6,120,738
Members
448,988
Latest member
BB_Unlv

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