You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Excel技术需求:获取指定范围最大值地址及姓氏匹配最大值对应种族

Alright, let's tackle your two Excel tasks step by step—they're totally doable with the right formulas, and we'll make sure the threshold is easy for end users to tweak.

1. 获取指定范围内最大值的地址

To get the cell address of the maximum value in a range (say, column L), you can use a combination of INDEX, MATCH, and CELL functions. Here's the formula:

=CELL("address", INDEX(L:L, MATCH(MAX(L:L), L:L, 0)))
  • MAX(L:L) grabs the largest value in column L.
  • MATCH(...) finds the row number where this maximum value first appears.
  • INDEX(L:L, ...) returns the actual cell containing the max value.
  • CELL("address", ...) converts that cell into its address (like $L$5).

Note: If there are multiple cells with the same maximum value, this formula will return the address of the first one.

2. 按姓氏匹配符合阈值条件的种族

Let's break this into two key parts: making the threshold editable, and returning the correct race for each last name.

Step 1: Set up an editable threshold

First, pick a cell (e.g., Z1) to store your threshold value (initially 60). Update your M列 formula to reference this cell instead of hardcoding 60:

=IF(L2>$Z$1, "X", "")

Now end users can just change the number in Z1 to adjust the threshold—no need to edit every formula in column M.

Step 2: Return the race for qualifying last names

Assume:

  • Your main data sheet is named Data (with last names in column A, L column values, M column "X" markers, and race in column C).
  • Your separate last name list is in a sheet named LastNames (last names in column A, where you want results in column B).

Use this formula in LastNames!B2 (drag down for all rows):

=LET(
    max_val, MAXIFS(Data!$L:$L, Data!$A:$A, LastNames!A2),
    IF(max_val>$Z$1, INDEX(Data!$C:$C, MATCH(max_val, FILTER(Data!$L:$L, Data!$A:$A=LastNames!A2), 0)), "")
)

What this does:

  1. LET(...) lets us define a variable max_val to store the highest L-column value for the current last name.
  2. We check if max_val exceeds the threshold in Z1.
  3. If yes: Use FILTER to get all L-column values for that last name, MATCH finds where the max value sits in that filtered list, then INDEX pulls the corresponding race from column C.
  4. If no: Returns an empty string (no result, like Johnson in your example).

If your Excel version doesn't support LET or FILTER (older versions):

Use this alternative array formula (enter with Ctrl+Shift+Enter instead of just Enter):

=IF(MAX(IF(Data!$A:$A=LastNames!A2, Data!$L:$L))>$Z$1, INDEX(Data!$C:$C, MATCH(MAX(IF(Data!$A:$A=LastNames!A2, Data!$L:$L)), Data!$L:$L, 0)), "")

This does the same job but uses nested IF functions instead of the newer dynamic array tools.


内容的提问来源于stack exchange,提问作者Sartorialist

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 08:35:12