简体   繁体   中英

Max If array formula with multiple criteria (no pivot tables)

I'm trying to return the MAX date [G-Step Complete]
for a series of rows with same values [CONCAT] ,
IF the date column [G-Step Complete] does NOT contain a BLANK.
However, if the date column [G-Step Complete] does contain a BLANK, return 0.

This is the array formula I am working with:

=MAX(IF([CONCAT]=[@CONCAT],IF(ISBLANK([G-Step Complete]),0,[G-Step Complete])))

The [CONCAT] column is sorted such that like items are grouped together.

My expectation is that IF any rows for a given group of CONCAT values is blank, then I would expect a result of 0. If NO rows contain a BLANK, then I would expect the value to return the MAX date.

With TB being the name of the table, this should do in Excel 2007 (and above) syntax:

=IF(SUMPRODUCT(([CONCAT]=TB[[#This Row],[CONCAT]])*ISBLANK([G-Step Complete])),0,
   LARGE([G-Step Complete]*(([CONCAT] = TB[[#This Row],[CONCAT]])), 1))

could be shortened with the @ operator in Excel 2010 and above versions:

=IF(SUMPRODUCT(([CONCAT]=[@CONCAT])*ISBLANK([G-Step Complete])),0,
   LARGE([G-Step Complete]*(([CONCAT]=[@CONCAT])), 1))

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