CountIF

gtd526

Well-known Member
Joined
Jul 30, 2013
Messages
657
Office Version
  1. 2019
Platform
  1. Windows
Hello,
Just wondering why its not counting correctly.
I, L, N = Values to Count according to CountIf in AB
AB = Countif

NBA.xlsm
ILNAB
4RankATS +/-Asst-Tovr RatioPick
51817.51.1111
615-10.51.1361
Favs
Cell Formulas
RangeFormula
I5:I6I5=VLOOKUP($A5,TeamRankings!$DD:$DE,2,0)
L5:L6L5=IFERROR(VLOOKUP(A5,TeamRankings!$CX$3:$DC$33,6,0),"")
N5N5=IFERROR(VLOOKUP(A5,TeamRankings!AT3:AW32,4,0),"")
AB5AB5=COUNTIF(I5,"<"&I6)+COUNTIF(L5,">"&L6)+COUNTIF(N5,">"&N6)
N6N6=IFERROR(VLOOKUP(A6,TeamRankings!AT3:AW32,4,0),"")
AB6AB6=COUNTIF(I6,"<"&I5)++COUNTIF(L6,">"&L5)+COUNTIF(N6,">"&N5)
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
I checked the same formula in excel and didn't find any issue. Result is 1 and 2.
I am checking in Excel 2019.
 

Attachments

  • countif.PNG
    countif.PNG
    3.9 KB · Views: 4
Upvote 0
Hello,
Just wondering why its not counting correctly.
I, L, N = Values to Count according to CountIf in AB
AB = Countif
in groups of two, rows: 5 & 6, 7 & 8, 9 & 10, etc.

NBA.xlsm
ILNAB
4RankATS +/-Asst-Tovr RatioPick
51817.51.1111
615-10.51.1361
Favs
Cell Formulas
RangeFormula
I5:I6I5=VLOOKUP($A5,TeamRankings!$DD:$DE,2,0)
L5:L6L5=IFERROR(VLOOKUP(A5,TeamRankings!$CX$3:$DC$33,6,0),"")
N5N5=IFERROR(VLOOKUP(A5,TeamRankings!AT3:AW32,4,0),"")
AB5AB5=COUNTIF(I5,"<"&I6)+COUNTIF(L5,">"&L6)+COUNTIF(N5,">"&N6)
N6N6=IFERROR(VLOOKUP(A6,TeamRankings!AT3:AW32,4,0),"")
AB6AB6=COUNTIF(I6,"<"&I5)++COUNTIF(L6,">"&L5)+COUNTIF(N6,">"&N5)
Here are the others. Don't know if its the (-) sign or vlookup??

Cell Formulas
RangeFormula
I5:I6I5=VLOOKUP($A5,TeamRankings!$DD:$DE,2,0)
L5:L14L5=IFERROR(VLOOKUP(A5,TeamRankings!$CX$3:$DC$33,6,0),"")
N5N5=IFERROR(VLOOKUP(A5,TeamRankings!AT3:AW32,4,0),"")
AB5,AB13,AB11,AB9,AB7AB5=COUNTIF(I5,"<"&I6)+COUNTIF(L5,">"&L6)+COUNTIF(N5,">"&N6)
N6N6=IFERROR(VLOOKUP(A6,TeamRankings!AT3:AW32,4,0),"")
AB6,AB14,AB12,AB10,AB8AB6=COUNTIF(I6,"<"&I5)+COUNTIF(L6,">"&L5)+COUNTIF(N6,">"&N5)
I7:I14I7=IFERROR(VLOOKUP($A7,TeamRankings!$DD:$DE,2,0),"")
N7N7=IFERROR(VLOOKUP(A7,TeamRankings!AT3:AW32,4,0),"")
N8N8=IFERROR(VLOOKUP(A8,TeamRankings!AT3:AW32,4,0),"")
N9N9=IFERROR(VLOOKUP(A9,TeamRankings!AT3:AW32,4,0),"")
N10N10=IFERROR(VLOOKUP(A10,TeamRankings!AT3:AW32,4,0),"")
N11N11=IFERROR(VLOOKUP(A11,TeamRankings!AT3:AW32,4,0),"")
N12N12=IFERROR(VLOOKUP(A12,TeamRankings!AT3:AW32,4,0),"")
N13N13=IFERROR(VLOOKUP(A13,TeamRankings!AT3:AW32,4,0),"")
N14N14=IFERROR(VLOOKUP(A14,TeamRankings!AT3:AW32,4,0),"")
 
Last edited:
Upvote 0
I didn't make any change but the result is different (see image).

What is the expected result ?
 

Attachments

  • countif-all.PNG
    countif-all.PNG
    19.1 KB · Views: 3
Upvote 0
I didn't make any change but the result is different (see image).

What is the expected result ?
results should be "should be".
If you hoover over AD5 it will show the formula.
I'm comparing 2 rows 5 & 6.

NBA.xlsm
KLMNADBE
4Cover %ATS +/-DiffAsst-Tovr RatioPickShould be
5100.0%18321.04312
60.0%-14.0-322.45501
Favs
Cell Formulas
RangeFormula
K5:K6K5=IFERROR(VLOOKUP(A5,TeamRankings!$BW$2:$BZ$33,4,0),"")
L5:L6L5=IFERROR(VLOOKUP(A5,TeamRankings!$BW$3:$CB$33,6,0),"")
M5M5=IFERROR((L5-L6),"")
N5N5=IFERROR(VLOOKUP(A5,TeamRankings!S3:V32,4,0),"")
AD5AD5=COUNTIF(K5,">"&K6)+COUNTIF(L5,">"&L6)+COUNTIF(N5,">"&N6)
M6M6=IFERROR((L6-L5),"")
N6N6=IFERROR(VLOOKUP(A6,TeamRankings!S3:V32,4,0),"")
AD6AD6=COUNTIF(I6,"<"&I5)+COUNTIF(L6,">"&L5)+COUNTIF(N6,">"&N5)
 
Upvote 0
I checked the same formula in excel and didn't find any issue. Result is 1 and 2.
I am checking in Excel 2019.

I checked the same formula in excel and didn't find any issue. Result is 1 and 2.
I am checking in Excel 2019.
You can use the XL2BB Addin to copy/post ranges so you don't have to type data. The upper left box below Fx allows you to copy to clipboard and paste where you need.
Here is a link for the download/install.
XL2BB - Excel Range to BBCode | MrExcel Message Board
 
Last edited:
Upvote 0
There is nothing wrong with your formula, although you could just use
Excel Formula:
=(K5>K6)+(L5>L6)+(N5>N6)
Check that you numbers are real numbers & not text
 
Upvote 0
There is nothing wrong with your formula, although you could just use
Excel Formula:
=(K5>K6)+(L5>L6)+(N5>N6)
Check that you numbers are real numbers & not text
Yes. I do a vlookup to data that is From Web (in Excel). So I change the format (Power Query) from Text to Number and it seems to work.
Thanks for the reply.
 
Upvote 0
Solution
I didn't make any change but the result is different (see image).

What is the expected result ?
I think I found a solution...
I do a vlookup to data that is From Web (in Excel). So I change the format (Power Query) from Text to Number and it seems to work.
thanks for the reply.
 
Upvote 0
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,043
Messages
6,122,812
Members
449,095
Latest member
m_smith_solihull

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