Countif & Indirect formula

jimmisavage

Board Regular
Joined
Jun 28, 2017
Messages
130
Hi, so i'm trying to work out a formula but i'm stumped because I don't really know what it does!

Basically, I have an old worksheet which successfully uses this formula pointing to a sheet called "Caravaggio": =COUNTIFS(Caravaggio!M2:M6000,">="&EOMONTH(TODAY(),-1)+1,Caravaggio!M2:M6000,"<="&EOMONTH(TODAY(),0))

I would want to change this formula so instead of calling from Caravaggio it would call from a sheet named in cell D5 + the word " Patients" - So if Caravaggio was in D5 it would be looking in a sheet called "Caravaggio Patients".

Something like this?? =COUNTIFS(INDIRECT("'"&$D$5 & " Patients"!M2:M6000,">="&EOMONTH(TODAY(),-1)+1,"'"&$D$5 & " Patients"!M2:M6000,"<="&EOMONTH(TODAY(),0)))

Although, that doesn't work because I can't get my head around it. Is anyone able to offer an alternative suggestion? I know i'm asking a lot!
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try
=COUNTIFS(INDIRECT("'"&$D$5 & " Patients'!M2:M6000"),">="&EOMONTH(TODAY(),-1)+1,INDIRECT("'"&$D$5 & " Patients'!M2:M6000"),"<="&EOMONTH(TODAY(),0))
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
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