Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
168 views
in Technique[技术] by (71.8m points)

Excel formula to find which of the matching rows has the latest Date, then update other rows with found value

A few requirements here. If you can imagine this sample table would be thousands of rows with varying Project Number values.

What I'm trying to do is use a formula that will do the following:

  1. Find all rows with the same Project Number.
  2. Of those matching rows, find which has the latest Date.
  3. Grab the value of column 2 from the row with latest date.
  4. Update the rows found in step 1 so that column 4 equals the value found in step 3.

Sample Table before formula

enter image description here

Desired outcome after formula

enter image description here

question from:https://stackoverflow.com/questions/65932201/excel-formula-to-find-which-of-the-matching-rows-has-the-latest-date-then-updat

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

With Excel365 you can use below formula.

=INDEX(SORT(FILTER($A$2:$C$6,$A$2:$A$6=A2),3,-1),1,2)

enter image description here

For non O365 user try below array formula.

=INDEX($B$2:$B$6,MATCH(MAX(IF($A$2:$A$6=A2,$C$2:$C$6,"")),$C$2:$C$6,0))

Press CTRL+SHIFT+ENTER to evaluate the formula as it is an array formula.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...