I am trying to calculate the last date for a designated account from a table where the net Amount for that account on that date is greater than 0 (in other words, where there was no return). I'm pretty sure this can be solved with an array formula (or SUMPRODUCT?), but I cannot figure out how to do it. Please see below.
In the below example I am trying to identify the last date for Account 1. Because the net amount for 08/03/2022 is 0 the formula should return 08/02/2022. I can write the array formula to calculate the last date (see cell G7 with formula displayed in H7), but I cannot figure out how to add a component to the formula that excludes dates where the net amount is 0. Can anyone help with a solution?
Thank you!
In the below example I am trying to identify the last date for Account 1. Because the net amount for 08/03/2022 is 0 the formula should return 08/02/2022. I can write the array formula to calculate the last date (see cell G7 with formula displayed in H7), but I cannot figure out how to add a component to the formula that excludes dates where the net amount is 0. Can anyone help with a solution?
Book2 | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | |||
1 | ||||||||||||
2 | ||||||||||||
3 | ||||||||||||
4 | Date | Account | Amount | |||||||||
5 | 8/1/2022 | 1 | 10 | |||||||||
6 | 8/2/2022 | 1 | 10 | Account | 1 | |||||||
7 | 8/3/2022 | 1 | 10 | Last Date | 8/3/2022 | =MAX(IF((C5:C12=G6),B5:B12)) | ||||||
8 | 8/3/2022 | 1 | -10 | |||||||||
9 | 8/1/2022 | 2 | 5 | |||||||||
10 | 8/2/2022 | 2 | 5 | |||||||||
11 | 8/2/2022 | 2 | -5 | |||||||||
12 | 8/4/2022 | 2 | 5 | |||||||||
13 | ||||||||||||
14 | ||||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
G7 | G7 | =MAX(IF((C5:C12=G6),B5:B12)) |
Press CTRL+SHIFT+ENTER to enter array formulas. |
Thank you!