ShadowRider
New Member
- Joined
- Sep 23, 2010
- Messages
- 27
- Office Version
- 365
- Platform
- MacOS
- Web
I can use index and match to find a particular cell in my array but I'd like to be able to do a year to date where I can sum all the cells that come up to the current month and in the current year.
I have the following example. N8 and N9 contain the user supplied criteria for month and date. I can find that specific cell in N11 ( in the example case, March, 2024). How do I sum Jan-Mar dynamically? ( Should mention that I will have Jan-Dec and multiple more years )
I have the following example. N8 and N9 contain the user supplied criteria for month and date. I can find that specific cell in N11 ( in the example case, March, 2024). How do I sum Jan-Mar dynamically? ( Should mention that I will have Jan-Dec and multiple more years )
Book1.xlsx | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | |||
1 | 2023 | 2024 | ||||||||||||||
2 | 1/1/23 | 2/1/23 | 3/1/23 | 4/1/23 | 2023 | 1/1/24 | 2/1/24 | 3/1/24 | 4/1/24 | 2024 | ||||||
3 | ||||||||||||||||
4 | 101 | 102 | 103 | 104 | 410 | 201 | 202 | 203 | 204 | 810 | ||||||
5 | ||||||||||||||||
6 | ||||||||||||||||
7 | ||||||||||||||||
8 | year | 2024 | ||||||||||||||
9 | month | 3 | ||||||||||||||
10 | ||||||||||||||||
11 | found | 203 | ||||||||||||||
12 | YTD | |||||||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
A2 | A2 | =DATE($A$1,1,1) |
B2 | B2 | =DATE($A$1,2,1) |
C2 | C2 | =DATE($A$1,3,1) |
D2 | D2 | =DATE($A$1,4,1) |
E2,K2 | E2 | =A1 |
G1 | G1 | =A1+1 |
G2 | G2 | =DATE($G$1,1,1) |
H2 | H2 | =DATE($G$1,2,1) |
I2 | I2 | =DATE($G$1,3,1) |
J2 | J2 | =DATE($G$1,4,1) |
E4,K4 | E4 | =SUM(A4:D4) |
N11 | N11 | =INDEX($A:$K,4,MATCH(DATE(N8,N9,1),$A$2:$K$2,0)) |
Last edited: