简体   繁体   中英

Multiple Conditions In MS Excel Array

I'm trying to find the median price (SP) of existing homes ( NewCon="No" ) for each month in my spreadsheet. For some reason, I get an error using each of the two formulas:

{=MEDIAN(IF(DATE(YEAR(Closing_Date),1,1)=$G2,IF(NewCon="No",SP)))}

Have also tried:

{=MEDIAN(IF(DATE(YEAR(Closing_Date),1,1)=$G2*(NewCon="No"),SP))}

Any help is greatly appreciated.

Spreadsheet_Image

Expected Outcome:

预期结果单元格I2包含公式

Use this regular formula:

=AGGREGATE(17,6,SP/((YEAR(Closing_Date)=$G2)*(NewCon="No")),2)

Or you can use your array entered formula:

=MEDIAN(IF((YEAR(Closing_Date)=$G2)*(NewCon="No"),SP))

With Ctrl-Shift-Enter.

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