How to match and sum multiple cells

ShadowRider

New Member
Joined
Sep 23, 2010
Messages
27
Office Version
  1. 365
Platform
  1. MacOS
  2. 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 )

Book1.xlsx
ABCDEFGHIJKLMN
120232024
21/1/232/1/233/1/234/1/2320231/1/242/1/243/1/244/1/242024
3
4101102103104410201202203204810
5
6
7
8year2024
9month3
10
11found203
12YTD
Sheet1
Cell Formulas
RangeFormula
A2A2=DATE($A$1,1,1)
B2B2=DATE($A$1,2,1)
C2C2=DATE($A$1,3,1)
D2D2=DATE($A$1,4,1)
E2,K2E2=A1
G1G1=A1+1
G2G2=DATE($G$1,1,1)
H2H2=DATE($G$1,2,1)
I2I2=DATE($G$1,3,1)
J2J2=DATE($G$1,4,1)
E4,K4E4=SUM(A4:D4)
N11N11=INDEX($A:$K,4,MATCH(DATE(N8,N9,1),$A$2:$K$2,0))
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
How about
Excel Formula:
=SUMIFS(4:4,2:2,">="&DATE(N8,1,1),2:2,"<"&DATE(N8,N9+1,1))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,187
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top