简体   繁体   中英

Excel Index match with multiple criteria using dates and numbers

Given the following spreadsheet I would like to find the first date after 5/16/2015 that also has a Payment amount > 0. So a Next Payment Date of "7/1/2015" is what I'm looking for.

在此处输入图片说明

I tried the following formula: =INDEX(A4:A10,MATCH($E$1,$A$4:$A$10,1)+ 1) but that gives me 6/1/2015 since it doesn't check if the payment is > 0. I have tried various ways of adding the second criteria but haven't been able to get it to work.

Thanks,

In E3 (.. F2?) as,

=INDEX(A:A, AGGREGATE(15, 6, ROW(A4:INDEX(A:A, MATCH(1E+99,A:A )))/((A4:INDEX(A:A, MATCH(1E+99,A:A ))>E2)*(B4:INDEX(B:B, MATCH(1E+99,A:A ))>0)), 1))

You will have to format as a date. The initial result will be 42186.

Use this array formula.

press CTRL + SHIFT + ENTER to evaluate it.

=INDEX(A4:A10,SMALL(IF(A4:A9>E1,IF(B4:B9>0,ROW(A4:A9)-ROW($A$3))),ROWS($A$4:$A4)))

在此处输入图片说明

Here is another Formula, In E2:

=SMALL(IF(A4:A9>$E$1,IF(B4:B9>0,A4:A9)),1)

It is an array formula and must be confirmed by Ctrl - Shift - Enter

在此处输入图片说明

This will find the first date after the date in E1 that is not 0 regardless of sort order.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM