Show Last Date if conditions are met

Colmans

Board Regular
Joined
May 28, 2016
Messages
62
Hi

I need to show the date of last activity on a report. In my head, I should use the IF function but cant get it to work. My logic is as follows:

=IF(Retailer_Name,D7,MAX(App_Date))

Retailer_Name = Retailers names as defined as a data range in worksheet
App_Date = date of application defined as a range

I'd also like to add an additional condition e.g Status = "Completed)

SO I have two collums, one which shows the last date of an application for the supplier, and one that shows the last date of a completed transaction for the supplier.

Thanks in advance for feedback.
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hello, I've assumed: (1) your retailer names are in A2:A17; (2) your application dates are in B2:B17; and (3) your statuses are in C2:C17.

Last application date goes in cell D2, then filled down:
Code:
{= MAX(($A$2:$A$17 = $A2) * $B$2:$B$17)}

Last completed application date goes in cell E2, then filled down:
Code:
{= MAX(($A$2:$A$17 = $A2) * ($C$2:$C$17 = "Completed") * $B$2:$B$17)}

Note these are array formulas, so don't type the curly braces. Just enter them with Ctrl + Shift + Enter.
 
Upvote 0
Thanks ParamRay for your response, but the date being returned is showing as 00/01/1900

I've also found an alternative, which strangely gives me the same answer 00/01/1900

{=MAX(IF(Retailer_Name=D2,IF(App_Status="Completed",App_Date)))}
 
Upvote 0
OK the following works, i'd not added the array in my worksheet

{=MAX(IF(Retailer_Name=D2,IF(App_Status="Completed",App_Date)))}

However, its only when there has been no activity against the retailer, it returns the 00/01/1900. What can I do to amend the formula e.g "No Activity" in the value for false. I've tried a number of combinations and its not liking them.

Thanks
 
Upvote 0
Try either of the 2 suggestions shown below.


Excel 2010
ABCDEF
1RetailerABC2-Mar-172-Mar-17
2ZZZ  
3
4dateRetailerStatus
51-Mar-17ABCOK
61-Mar-17DEFCompleted
71-Mar-17GGGOK
82-Mar-17ABCCompleted
92-Mar-17DEFOK
102-Mar-17GGGCompleted
1112-Mar-17ABCOK
1212-Mar-17SSSCompleted
1312-Mar-17SSSXX
14
1cc
Cell Formulas
RangeFormula
F1=IF(COUNTIF($B$5:$B$13,D1),AGGREGATE(14,6,A$5:A$13/(B$5:B$13=$D$1)*($C$5:$C$13="Completed"),ROWS($A$1:$A1-$A$1+1)),"")
F2=IF(COUNTIF($B$5:$B$13,D2),AGGREGATE(14,6,A$5:A$13/(B$5:B$13=$D$1)*($C$5:$C$13="Completed"),ROWS($A$1:$A2-$A$1+1)),"")
E1{=MAX(IF($B$5:$B$13=D1, IF($C$5:$C$13="Completed", $A$5:$A$13)))}
E2{=MAX(IF($B$5:$B$13=D2, IF($C$5:$C$13="Completed", $A$5:$A$13)))}
Press CTRL+SHIFT+ENTER to enter array formulas.


If the Retailer does not exist, the formula will yield 0.
To suppress the 0, uncheck the option to show a zero with zero values located in Options ! Advanced ! Display
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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