如果Google张公司名称重复,如何获取相关日期?

How to get the related date if the company name is duplicated in Google Sheets?

如果公司名称重复,我正在尝试获取公司名称对应的日期。

Public google sheet

Company date date duplicated company date
one jan1
two jan1
one feb1 jan1 (find this using some formula)
two feb4 jan1
two mar3 feb4 (if repeated take the previous date)
three apr1
four apr5

没有好的办法。特别是如果我们一开始就不知道为什么要这样做。

我能得到的最接近的是使用 FILTER:

=IFERROR(INDEX(FILTER($B:$B2;$A:$A2=$A3);COUNTA(FILTER($B:$B2;$A:$A2=$A3)));"")

将其放在数据的第二行(如果有 headers,则放在 table 的第 3 行),因为它不适用于第一行。然后,将此公式向下拖动到所有行。

注:

  • A2 是我第一家公司的所在地,比如“Apple”
  • B2 是我第一次约会的地方,比如“1 月 1 日”

您可以将此公式放在 C3 中,并使用突出显示的单元格 bottom-right 角中的彩色方块 drag-copy 到它下面的所有行。

(以防你不知道)

玩得开心! ^_^