简体   繁体   English

如何在Excel中找到多个组的最大值和最小值?

[英]How do I find the max & min values of multiple groups in an Excel?

I know about the Pivot-table, but I need summary data in display. 我知道数据透视表,但是我需要显示摘要数据。 That means that I'm also doing other datagathering and Pivot just won't do. 这意味着我也在做其他数据收集,而Pivot只是不做。

My table looks something like this: 我的桌子看起来像这样:

Date | Value | Weekday
1.1. | 5903  | Thursday
2.1. | 2981  | Friday
5.1. | 3046  | Monday
6.1. | 5021  | Tuesday
7.1. | 6785  | Wednesday
8.1. | 5074  | Thursday
9.1. | 3631  | Friday
12.1.| 7083  | Monday
13.1.| 3531  | Tuesday
14.1.| 5589  | Wednesday
15.1.| 2068  | Thursday
16.1.| 6485  | Friday
19.1.| 7013  | Monday
20.1.| 3802  | Tuesday
21.1.| 5291  | Wednesday
22.1.| 6142  | Thursday

I need to find the MAX and MIN values by the weekday. 我需要在工作日之前找到MAX和MIN值。 Note that my table is ordered by dates. 请注意,我的表是按日期排序的。 I've heard not-so-great stories about VLOOKUP. 我听说过关于VLOOKUP的故事。

So the answers would be: 因此答案将是:

MAX
    12.1.| 7083  | Monday
    6.1. | 5021  | Tuesday
    7.1. | 6785  | Wednesday
    22.1.| 6142  | Thursday
    16.1.| 6485  | Friday

MIN
    5.1. | 3046  | Monday
    13.1.| 3531  | Tuesday
    21.1.| 5291  | Wednesday
    15.1.| 2068  | Thursday
    2.1. | 2981  | Friday

What would be the right formula? 正确的公式是什么?

You can use either array or standard pseudo-MINIF/MAXIF formulas to retrieve the value but then you will need a two column lookup to retrieve the value from the Date column. 您可以使用数组或标准伪MINIF / MAXIF公式来检索值,但随后需要两列查找才能从“日期”列中检索值。

MINIF和MAXIF具有两列查找

The formulas for E4:F4,E11:F11 are: E4:F4,E11:F11的公式为:

'E4
=INDEX($A$2:$A$9999, MIN(INDEX(ROW($1:$9998)+(($B$2:$B$9999<>F4)+($C$2:$C$9999<>G4))*1E+99, , )))
'F4
=MAX(INDEX($B$2:$B$9999*($C$2:$C$9999=G4),,))
'AGGREGATE alternative for F4
=AGGREGATE(14, 6, 1/($C$2:$C$9999=G4)*($B$2:$B$9999),1)
'E11
=INDEX($A$2:$A$9999, MIN(INDEX(ROW($1:$9998)+(($B$2:$B$9999<>F11)+($C$2:$C$9999<>G11))*1E+99, , )))
'F11
=MIN(INDEX($B$2:$B$9999+($C$2:$C$9999<>G11)*1E+99,,))
`F11 where zeroes are discarded
=MIN(INDEX($B$2:$B$9999+(($C$2:$C$9999<>G11)+($B$2:$B$9999=0))*1E+99,,))
'AGGREGATE alternative for F11
=AGGREGATE(15, 6, 1/($C$2:$C$9999=G11)*($B$2:$B$9999),1)

Fill each E:F area down as necessary. 必要时向下填充每个E:F区域。 These formula depend upon the weekday values in columns C & G being text strings; 这些公式取决于C和G列中的工作日值是文本字符串。 a different approach is required if these are actual dates formatted as mmmm 如果这些是格式为mmmm的实际日期,则需要采用其他方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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