help with adding max date

Imran Azam

Board Regular
Joined
Mar 15, 2011
Messages
103
HI Guys

i have a countifs statement that is doing the on the below set of data

[TABLE="width: 265"]
<tbody>[TR]
[TD]Name[/TD]
[TD]Status[/TD]
[TD]date[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]Qualified[/TD]
[TD="align: right"]30/03/2019[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]Qualified[/TD]
[TD="align: right"]30/05/2019[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]Qualified[/TD]
[TD="align: right"]30/04/2019[/TD]
[/TR]
[TR]
[TD]Alex[/TD]
[TD]Not Qualified[/TD]
[TD="align: right"]29/04/2019[/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD]Not Qualified[/TD]
[TD="align: right"]26/04/2019[/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD]Qualified[/TD]
[TD="align: right"]26/04/2019[/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD]Qualified[/TD]
[TD="align: right"]30/04/2019[/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD]Not Qualified[/TD]
[TD="align: right"]30/04/2019[/TD]
[/TR]
[TR]
[TD]James[/TD]
[TD]Not Qualified[/TD]
[TD="align: right"]30/04/2019[/TD]
[/TR]
</tbody>[/TABLE]

the logic i am trying to use is if Name is Alex and State = Qualified and date is between 01/01/2019 and 30/04/2019 and the maxdate is >= april 2019 then return the count of the name else return blank.

I have created this formula
=COUNTIFS(A2:A10,"Alex",B2:B10,"Qualified",C2:C10,">="&DATEVALUE("01/01/2019"),C2:C10,"<="&DATEVALUE("30/04/2019"))/COUNTIFS(A2:A10,"Alex",C2:C10,">="&DATEVALUE("01/01/2019"),C2:C10,"<="&DATEVALUE("30/04/2019"))

this covers most of the logic but i dont know how i can add the maxdate logic

can this be done?

can anyone help?

Thank s
 
Last edited:

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
It's not clear what you are trying to do.
What is maxdate? What is the expected result?

M.
 
Upvote 0
Thank you for the reply M, sorry i didnt make sense. I want the count if formula which i added above only to work if the latest date in the date field is april 2019 ,if the latest data isnt april 2019 then return blank, so in the above example as the latest date is 30/05/2019 therefore it should return a blank
 
Upvote 0
Maybe...

=IF(AND(MONTH(MAX(C2:C10))=4,YEAR(MAX(C2:C10))=2019),COUNTIFS(A2:A10,"Alex",B2:B10,"Qualified",C2:C10,">="&DATEVALUE("01/01/2019"),C2:C10,"<="&DATEVALUE("30/04/2019"))/COUNTIFS(A2:A10,"Alex",C2:C10,">="&DATEVALUE("01/01/2019"),C2:C10,"<="&DATEVALUE("30/04/2019")),"")

M.
 
Upvote 0
thanks it worked
Maybe...

=IF(AND(MONTH(MAX(C2:C10))=4,YEAR(MAX(C2:C10))=2019),COUNTIFS(A2:A10,"Alex",B2:B10,"Qualified",C2:C10,">="&DATEVALUE("01/01/2019"),C2:C10,"<="&DATEVALUE("30/04/2019"))/COUNTIFS(A2:A10,"Alex",C2:C10,">="&DATEVALUE("01/01/2019"),C2:C10,"<="&DATEVALUE("30/04/2019")),"")

M.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,170
Members
453,021
Latest member
Justyna P

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