MAX date, item match and empty cells

reiroch171

New Member
Joined
May 6, 2019
Messages
2
Hello Board,

Here is my dilemma.
I am trying to populate column H with the MAX date from column C where:
  1. item code matches (A=G)
  2. D is blank

If no items in D are blank, make zero. (I will conditional format so it's blank and not 1/0/1900 if I need to)

Note, this table A-D will NOT be sorted at all, so I don't think lookup will work?

I searched the forums and came up with the parts - sumproduct, max(if(etc)) but I can't get the whole thing to work.


[TABLE="width: 841"]
<colgroup><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]
[/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[/TR]
[TR]
[TD="align: center"]1
[/TD]
[TD="align: center"]renting serial
[/TD]
[TD="align: center"]Date out[/TD]
[TD="align: center"]Expected back[/TD]
[TD="align: center"]Actual back[/TD]
[TD] [/TD]
[TD] [/TD]
[TD="align: center"]ItemCode
[/TD]
[TD="align: center"]Date expected back[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD]ABC
[/TD]
[TD="align: right"]10-Feb[/TD]
[TD="align: right"]12-Feb[/TD]
[TD="align: right"]12-Feb[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]ABC[/TD]
[TD="align: right"]1/0/1900
[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD]ABC
[/TD]
[TD="align: right"]10-Apr[/TD]
[TD="align: right"]15-Apr[/TD]
[TD="align: right"]12-Apr[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]DEF[/TD]
[TD="align: right"]5/20/2019[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD]ABC[/TD]
[TD="align: right"]2-May[/TD]
[TD="align: right"]5-May[/TD]
[TD="align: right"]6-May[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]GHI[/TD]
[TD="align: right"]1/0/1900[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD]DEF[/TD]
[TD="align: right"]1-May[/TD]
[TD="align: right"]5-May[/TD]
[TD="align: right"]5-May[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]JKL[/TD]
[TD="align: right"]2/12/2019[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD]DEF[/TD]
[TD="align: right"]1-May[/TD]
[TD="align: right"]20-May[/TD]
[TD]
[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]
[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD]GHI[/TD]
[TD="align: right"]8-Feb[/TD]
[TD="align: right"]10-Feb[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD]GHI
[/TD]
[TD="align: right"]1-Apr[/TD]
[TD="align: right"]10-Apr[/TD]
[TD="align: right"]10-Apr[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD]JKL[/TD]
[TD="align: right"]10-Feb[/TD]
[TD="align: right"]12-Feb[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody>[/TABLE]

What I tried:

Example: =SUMPRODUCT((Table13[renting serial]=$H2)*(Table13[Actual back]=0)) gets me just the count of lines
=MAX(IF(Table13[renting serial]=H2,Table13[Expected back])) gets me just the max date in the whole column.

Thanks so much,
Susan
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Welcome to the Board.

Try this formula in H2:

=MAX(IF($A$2:$A$9=G2,IF($D$2:$D$9="",$C$2:$C$9)))
and confirm it with Control+Shift+Enter. Drag down the column.

If you have Excel 365, check out the MAXIFS function.
 
Upvote 0
Hi & welcome to MrExcel.
How about


Excel 2013/2016
ABCDEFGH
1renting serialDate outExpected backActual backItemCodeDate expected back
2ABC10-Feb12/02/201912-FebABC00/01/1900
3ABC10-Apr15/04/201912-AprDEF20/05/2019
4ABC02-May05/05/201906-MayGHI10/02/2019
5DEF01-May05/05/201905-MayJKL12/02/2019
6DEF01-May20/05/2019
7GHI08-Feb10/02/2019
8GHI01-Apr10/04/201910-Apr
9JKL10-Feb12/02/2019
Doc1
Cell Formulas
RangeFormula
H2{=MAX(IF((Table13[renting serial]=G2)*(Table13[Actual back]=""),Table13[Expected back]))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Thanks that worked great.

Ps I was a user here like 8 years ago from my old job - can't remember the login though, so I started fresh :)
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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