简体   繁体   中英

Excel large function

I want to find the X most recent results for a given tennis player in a table with fields for player name (column A), date (column B) and result ("W" or "L" in column C).

I've tried using the large function with the date field in different ways but nothing seems to work. Eg

=COUNTIFS($A$2:$A$30,"andy murray",$B$2:$B$30,LARGE($B$2:$B$30,{1,2,3,4,5}),$C$2:$C$30,"W")

=AND($A$2:$A$30="andy murray",$B$2:$B$30=LARGE($B$2:$B$30,1),$C$2:$C$30="W")

Repeating this last one when k=2, k=3 etc.

Any help would be greatly appreciated.

图片来自评论

You can do it with something like this:

=MAX(IF((A2:A18="Andy Murray")*(C2:C18="W"), B2:B18))

OR

=MAX(IF(A2:A18="Andy Murray", B2:B18))

NOTE: After putting in the formula you have to hit SHIFT + CTRL + ENTER on a PC or COMMAND + ENTER on a Mac. Very important.

The top one gives you the most recent win, the bottom one gives you most recent game played.

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