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
245 views
in Technique[技术] by (71.8m points)

excel - Return latest balance between two dates

I'm looking for a formula that could give me the latest balance between two dates. I have one cell for the starting date and cell one for the end date.I also have some duplicate dates for each accounts in my file. This is the formula that I have right now in my file that is working well but now I need to put the date range in the formula: =LOOKUP(10^35;$F$15:$F$68/($D$15:$D$68=$E8))

To translate the formula that I have in the file vs the example below, it would be something like this:

=LOOKUP(10^35;$C$2:$C$4/($D$2:$D$5=$F4))
A B C D E F
1 DATE AMOUNT BALANCE ACCOUNT START DATE: Jan-1-2020
2 Jan-5-2020 50$ 50$ ABC... END DATE: Dec-31-2020
3 Dec-30-2020 60$ 110$ ABC...
4 Dec-30-2020 40$ 150$ ABC... ABC...
5 Dec-31-2020 100$ 100$ DEF... DEF...
question from:https://stackoverflow.com/questions/66055333/return-latest-balance-between-two-dates

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

1 Reply

0 votes
by (71.8m points)

Use INDEX/AGGREGATE:

=INDEX(C:C,AGGREGATE(14,7,ROW($C$2:$C$5)/(($A$2:$A$5>=$F$1)*($A$2:$A$5<=$F$2)*($D$2:$D$5=F4)),1))

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

...