Help SUMIF with YTD

shepcs

Board Regular
Joined
Feb 2, 2003
Messages
72
Office Version
  1. 365
Platform
  1. Windows
Would greatly appreciate any help as its driving me nuts.
I'm trying to do a YTD summation given a value to lookup in a single column (Column C), then doing a ytd in the Jan-Dec columns (E:P).
So for Inputs I have a number to lookup in a column and a date (in this case E2: 400101 and E3: 05/31/22)

For a single value its no problem, I do
=SUMIF($C:$C,E3,INDEX($E:$P,,MATCH(E2,$E$6:$P$6,0)))

And I know the YTD formula works but this is inputting a specific row (E12:P12) instead of location the row by the input number E2
=SUMIF($E$6:$P$6,"<="&E2,E12:P12)

I'm trying to combine the two and running into a problem.

Really appreciate any insight.
Thanks!!
 

Attachments

  • SUMIF Help3.JPG
    SUMIF Help3.JPG
    243.9 KB · Views: 24

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Maybe
Excel Formula:
=SUMPRODUCT(($C11:$C500=E3)*($E$6:$P$6<=E2)*(E11:P500))
 
Upvote 0
Just updated my info thanks. But that formula doesnt work.
 
Upvote 0
It just gives me a value of zero instead of the (1269521)
 
Upvote 0
In that case can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Now that we know you have 365, this will be relevant!
Book1
BCDEFGHIJKLMN
1InputMonthYTD
2Month: Mar-2215,224
3Dept: 400100
4
5DeptJan-22Feb-22Mar-22Apr-22May-22Jun-22Jul-22Aug-22Sep-22Oct-22Nov-22Dec-22
64001007,2562,1475,8217,7423,3584,2981,4919,5349,3783,4274,4968,370
74001109,6465,3416,7149,3568,9518,2362,0114,4219,8499,6892,5597,365
84001206,0056,0144,9555,0343,0304,2265,0277,2371,3735,7638,3731,132
94001303,3918,8968,0466,7214,6199,5694,9698,1257,1373,3952,7936,875
104001405,7057,5592,9265,4565,1589,7258,8688,0009,7891,7004,4747,823
Sheet1
Cell Formulas
RangeFormula
D2D2=SUM(FILTER(FILTER(C6:N10,(MONTH(C5#)<=MONTH(C2))),B6#=C3))
C5:N5C5=EOMONTH(DATEVALUE("1/1/2022"),SEQUENCE(,12,0))
B6:B10B6=SEQUENCE(5,,400100,10)
Dynamic array formulas.
Cells with Data Validation
CellAllowCriteria
C2List=$C$5#
C3List=$B$6#
And yes, would be helpful to use XL2BB instead of having to make it up!
 
Upvote 0
Thanks jdellasala! I'm still trying to digest what you gave me. And will do on the XL2BB. I appreciate it!
 
Upvote 0
I guess I'm still doing something wrong. I tried tweaking it but couldnt get it to work regardless. I got xl2bb to work
SUMIF HELP.xlsx
ABCDEFGHIJKLMN
1
2RAW Data
3DEPTJan-22Feb-22Mar-22Apr-22May-22Jun-22Jul-22Aug-22Sep-22Oct-22Nov-22Dec-222022
44001009,866,4466,198,6376,198,6376,198,63711,768,27414,485,17044,778,560-----99,494,360
5400101(587,340)(388,978)(242,392)(17,025)(33,785)(55,538)(134,922)-----(1,459,981)
6400160372,034372,034372,034372,034372,034372,034372,0347,378,5347,378,5347,378,5345,292,5775,292,57735,324,994
7400170-------------
8400171-------------
9
10Reporting Page
11Date Input05/31/22
12YTD May Output
13Dept Input400100#REF!
14Dept Input400101#REF!
15Dept Input400160#REF!
16Dept Input400170#REF!
17Dept Input400171#REF!
Sheet1 (2)
Cell Formulas
RangeFormula
C13:C17C13=SUM(FILTER(FILTER($B$4:$M$8,(MONTH(B$3:M$3)<=MONTH($B$11))),A:A#=B13))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
B11Expression=#REF!<>0textYES
E1Expression=#REF!<>0textYES
B10:B11Expression=#REF!<>0textYES
G1:M1,C1,B10:B11,N1:N2Expression=#REF!<>0textYES
 
Upvote 0
I come up with this, without filter:
Book1
ABCDEFGHIJKLMN
1
2RAW Data
3DEPT2022-01-312022-02-282022-03-312022-04-302022-05-312022-06-302022-07-312022-08-312022-09-302022-10-312022-11-302022-12-311905-07-14
44001009866446.46198636.86198636.86198636.811768273.614485169.6447785600000099494360
5400101-587340.07-388978.11-242392.4047-17025.1807-33785.4168-55537.9333-134921.82700000-1459980.94
6400160372033.93372033.93372033.93372033.93372033.93372033.93372033.937378533.937378533.937378533.935292577.435292577.4335324994.16
74001700000000000000
84001710000000000000
9
10Reporting Page
11Date Input2022-05-31
12YTD May Output
13Dept Input400100#REF!11,768,273.60
14Dept Input400101#REF!(33,785.42)
15Dept Input400160#REF!372,033.93
16Dept Input400170#REF!-
17Dept Input400171#REF!-
Sheet3
Cell Formulas
RangeFormula
C13:C17C13=SUM(FILTER(FILTER($B$4:$M$8,(MONTH(B$3:M$3)<=MONTH($B$11))),A:A#=B13))
D13:D17D13=SUMPRODUCT((--($B13=$A$4:$A$8))*(--(MONTH($B$11)=MONTH($B$3:$N$3)))*($B$4:$N$8))
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,197
Members
453,022
Latest member
RobertV1609

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