# Combining CountIF and Vlookup

#### dhana_ram

##### New Member
Hi All!

I'm currently trying to find a way to count how many data "high" in each month. Example: I want to count how many "high" data only in month 1, and how many "Low" in month 4.

I've tried =COUNTIF(VLOOKUP(A2,A2:B18,2,0),"HIGH") but it doesn't work.

Does anyone know how to obtain these data?

Thanks alot!

#### Attachments

• Capture 1.JPG
25.9 KB · Views: 7

### Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

##### Well-known Member
Welcome to MrExcel Message Board:
Book1
ABCDEFGHIJKLM
1MonthStockMonthCountMonthStockMonthCount
21Low111/3/2021Low11
31High231/11/2021High23
41Low311/19/2021Low31
51Low421/27/2021Low41
62High522/4/2021High52
72High612/12/2021High62
82Low2/20/2021Low
92High2/28/2021High
103Low3/8/2021Low
113Low3/16/2021Low
123High3/24/2021High
133Low4/1/2021Low
144Low4/9/2021Low
154High4/17/2021High
164Low4/25/2021Low
174High5/3/2021High
185High5/11/2021High
195Low5/19/2021Low
205Low5/27/2021Low
215High6/4/2021High
226Low6/12/2021Low
236Low6/20/2021Low
246High6/28/2021High
256Low7/6/2021Low
26
27
Sheet1
Cell Formulas
RangeFormula
E2:E7E2=SUMPRODUCT((\$B\$2:\$B\$25="High")*(\$A\$2:\$A\$25=D2))
L2:L7L2=SUMPRODUCT((\$I\$2:\$I\$25="High")*(--MONTH(\$H\$2:\$H\$25)=K2))
A3:A25A3=IF(MOD(ROW(),4)=2,A2+1,A2)

#### Peter_SSs

##### MrExcel MVP, Moderator
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Unless you have a very old version of Excel, COUNTIFS provides an efficient formula for your counts.
For example

21 10 03.xlsm
ABCDEF
1MonthStockMonthHighLow
21Low113
31High231
41Low313
51Low422
62High522
72High613
82Low
92High
103Low
113Low
123High
133Low
144Low
154High
164Low
174High
185High
195Low
205Low
215High
226Low
236Low
246High
256Low
Count High
Cell Formulas
RangeFormula
E2:F7E2=COUNTIFS(\$A\$2:\$A\$25,\$D2,\$B\$2:\$B\$25,E\$1)

#### dhana_ram

##### New Member
Welcome to MrExcel Message Board:
Book1
ABCDEFGHIJKLM
1MonthStockMonthCountMonthStockMonthCount
21Low111/3/2021Low11
31High231/11/2021High23
41Low311/19/2021Low31
51Low421/27/2021Low41
62High522/4/2021High52
72High612/12/2021High62
82Low2/20/2021Low
92High2/28/2021High
103Low3/8/2021Low
113Low3/16/2021Low
123High3/24/2021High
133Low4/1/2021Low
144Low4/9/2021Low
154High4/17/2021High
164Low4/25/2021Low
174High5/3/2021High
185High5/11/2021High
195Low5/19/2021Low
205Low5/27/2021Low
215High6/4/2021High
226Low6/12/2021Low
236Low6/20/2021Low
246High6/28/2021High
256Low7/6/2021Low
26
27
Sheet1
Cell Formulas
RangeFormula
E2:E7E2=SUMPRODUCT((\$B\$2:\$B\$25="High")*(\$A\$2:\$A\$25=D2))
L2:L7L2=SUMPRODUCT((\$I\$2:\$I\$25="High")*(--MONTH(\$H\$2:\$H\$25)=K2))
A3:A25A3=IF(MOD(ROW(),4)=2,A2+1,A2)

#### dhana_ram

##### New Member

And also thanks for reminding to set my excel version info. Will do.

Cheers!
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Unless you have a very old version of Excel, COUNTIFS provides an efficient formula for your counts.
For example

21 10 03.xlsm
ABCDEF
1MonthStockMonthHighLow
21Low113
31High231
41Low313
51Low422
62High522
72High613
82Low
92High
103Low
113Low
123High
133Low
144Low
154High
164Low
174High
185High
195Low
205Low
215High
226Low
236Low
246High
256Low
Count High
Cell Formulas
RangeFormula
E2:F7E2=COUNTIFS(\$A\$2:\$A\$25,\$D2,\$B\$2:\$B\$25,E\$1)

##### Well-known Member
You're Welcome & Thanks for follow-up.

#### Peter_SSs

##### MrExcel MVP, Moderator
And also thanks for reminding to set my excel version info. Will do.
You're welcome. And thanks for updating your profile.

Replies
3
Views
63
Replies
4
Views
172
Replies
3
Views
111
Replies
7
Views
297
Replies
2
Views
212

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,466
Messages
5,831,792
Members
430,087
Latest member
meagerd

### 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.

### Which adblocker are you using?

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

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