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

时间:2022-09-28 14:49:04

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表,但我需要显示摘要数据。这意味着我也在做其他数据收集而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. Note that my table is ordered by dates. I've heard not-so-great stories about VLOOKUP.

我需要在工作日找到MAX和MIN值。请注意,我的表按日期排序。我听说过关于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?

什么是正确的公式?

1 个解决方案

#1


0  

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公式来检索值,但是您需要进行两列查找以从Date列中检索值。

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

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. These formula depend upon the weekday values in columns C & G being text strings; a different approach is required if these are actual dates formatted as mmmm

根据需要填写每个E:F区域。这些公式取决于C&G列中的工作日值是文本字符串;如果这些是格式为mmmm的实际日期,则需要采用不同的方法

#1


0  

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公式来检索值,但是您需要进行两列查找以从Date列中检索值。

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

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. These formula depend upon the weekday values in columns C & G being text strings; a different approach is required if these are actual dates formatted as mmmm

根据需要填写每个E:F区域。这些公式取决于C&G列中的工作日值是文本字符串;如果这些是格式为mmmm的实际日期,则需要采用不同的方法