How to assign a cell to a countif function

Tyrel Smith

New Member
Joined
Nov 20, 2020
Messages
26
Office Version
  1. 2016
Platform
  1. Windows
Can someone help me please,

I'm trying to get this COUNTIF function's criteria to be a cell (see image below)

it works fine when I have it as =COUNTIF(P2100:P2205;"Nov 2020")
but then every month I would have to change it manually.
cell N2208(highlighted in green) updates automatically every month that's why I want to use N2208 as the criteria for it but when I use it as =COUNTIF(P2100:P2205;N2208) it doesn't work.
I'm using excel 2010
Any help will be muchly appreciated even if it is a vba script.

thank you
Screenshot (299).png
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
What is in N2208?

Please update your account details to show which version of Excel you are using. It saves you from having to tell us every time.
 
Upvote 0
What is in N2208?

Please update your account details to show which version of Excel you are using. It saves you from having to tell us every time.
Today() function and the formated the cell to display Nov 2020.

the cell is next to the cell with 11 in it(to the left of it)
 
Upvote 0
Ok, that's probably the reason as the formula is looking for cells with today's date.
Try
Excel Formula:
=TEXT(TODAY(),"mmm yyyy")
instead.
 
Upvote 0
Ok, that's probably the reason as the formula is looking for cells with today's date.
Try
Excel Formula:
=TEXT(TODAY(),"mmm yyyy")
instead.
I tried that and I get the current month and year (displayed in cell highlighted in red) but the cell highlighted in blue is still 0 yet the cells above it have Nov 2020
 
Upvote 0
In that case how about
Excel Formula:
=COUNTIFS(P:P,">="&EOMONTH(N2208,-1)+1,P:P,"<="&EOMONTH(N2208,0))
with N2208 having your original formula
 
Upvote 0
In that case how about
Excel Formula:
=COUNTIFS(P:P,">="&EOMONTH(N2208,-1)+1,P:P,"<="&EOMONTH(N2208,0))
with N2208 having your original formula
so I must put COUNTIF(P2195:P2206;) into N2208, what must I put the criteria as?
and =COUNTIFS(P:P,">="&EOMONTH(N2208,-1)+1,P:P,"<="&EOMONTH(N2208,0)) in P2207
 
Upvote 0
No N2208 needs to be formula you originally had in that cell, ie the Today function.
 
Upvote 0
Solution

Forum statistics

Threads
1,224,728
Messages
6,180,598
Members
452,988
Latest member
wcself81

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