Google表格:如何在Google表格公式中查找给定数据集(日期-值对)的最高价值以及日期? [英] Google Sheet: How to find Highest Value along with the date for given set of data(date-value pair) in Google Sheet Formula?

查看:91
本文介绍了Google表格:如何在Google表格公式中查找给定数据集(日期-值对)的最高价值以及日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Google表格中具有日期-值对格式的以下数据:

<身体>
日期
1/8/2021 1301.85
2021年1月1日 1303.9
2021年1月1日 1320.05
1/13/2021 1291.55
1/14/2021 1287.45
1/15/2021 1270

我正在寻找一个Google工作表公式,该公式将返回输出:最大值及其关联的日期.这意味着我试图获得如下输出: 1/12/2021 1320.05

解决方案

您还可以使用

公式中的 SORTN 函数如何工作

  • 1 是要退回的商品数",(因为我们只需要将max设置为1)
  • 0 最多显示前n行";(这就是所谓的ties_mode,在我们的情况下为0)
  • 2 是包含要排序的值的列的索引".这是第二列
  • 0 "表示如何对sort_column进行排序.TRUE (或1)以升序排序.FALSE (或0)降序排列".

I have below data in date-value pair format in Google Sheet:

Date Value
1/8/2021 1301.85
1/11/2021 1303.9
1/12/2021 1320.05
1/13/2021 1291.55
1/14/2021 1287.45
1/15/2021 1270

I'm looking for a google sheet formula that will return output: highest value along with its associated date. That means I'm trying to get the output as below: 1/12/2021 1320.05

解决方案

You can also use the SORTN function.
The difference being, by using an INDEX formula you need to re-format the column A result to a date while using SORTN you don't.

=SORTN(A2:B,1,0,2,0)

How the SORTN function in our formula works

  • 1 is "the number of items to return" (since we need just the max we set it to 1)
  • 0 "Shows at most the first n rows" (this is the so called ties_mode, in our case 0)
  • 2 is "the index of the column containing the values to sort by" which here is the 2nd column
  • 0 "indicates how to sort the sort_column. TRUE (or 1) sorts in ascending order. FALSE (or 0) sorts in descending order".

这篇关于Google表格:如何在Google表格公式中查找给定数据集(日期-值对)的最高价值以及日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆