Sum IFs linked to Dates

lisa_swinton

New Member
Joined
Sep 2, 2022
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Please see below mini sheet I'm trying to create the correct formula so that in the summary sheet row 11 can generate the next month in a sequence but then in the line 13 summaries data from the "data" sheet column U linked to the Date Column M. But it seems that in the data sheet I would need to have the exact same date as the Summary sheet but this wont be the case. Is there a way to summaries the data only from the MMM-YY and it not require exact date. Appreciate some pointers

Formula help.xlsx
ABCDEFGHIJKLMN
1CSA Date30-Sep-22
2Remaining TC500
3No. Months10
4
5109876543210-1-2
6Include?1111111111111
7Month9101112123456789
8Year2022202220222022202320232023202320232023202320232023
9
10
11Sep-22Oct-22Nov-22Dec-22Jan-23Mar-23Apr-23May-23Jun-23Jul-23Aug-23Sep-23Oct-23
12TC at start of period500130100100100100100100100100100100100
13Risk Impact during period-370-3000000000000
14Remaining TC130100100100100100100100100100100100100
15
16Exp Cost per Month-370-3000000000000
17
summary
Cell Formulas
RangeFormula
B1B1=data!W2
B2B2=data!N10
B5B5=B3
C5:N5C5=B5-B6
B7B7=MONTH(B1)
C7:N7C7=IF(C6=1, IF(B7+1=13, 1, B7+1), 0)
B8B8=YEAR(B1)
C8:N8C8=IF(C6=1, IF(B7=12, B8+1, B8), 0)
B11:B12B11=B1
C11:N11C11=DATE(YEAR(B11),MONTH(B11)+1,DAY(B11))
C12:N12C12=IF(C6=1, B14, "")
B13B13=SUMIF(data!$M$15:$M$74, B11, data!$U$15:$U$74)
C13C13=IF(C6=1,SUMIF(data!$M$15:$M$74,C11,data!$U$15:$U$74), "")
D13:N13D13=IF(D6=1,SUMIF(data!$M$15:$M$74,summary!D11,data!$U$15:$U$74), "")
B14B14=B12+B13
C14:N14C14=IF(C6=1, C12+C13, "")
B16:N16B16=IF(B6=1, B13, "")


Formula help.xlsx
DEIJKLMNOPQRSTUVWX
2CSA Date:Sep-22
3
4
5
6
7
8
9
10TC3,0003,000 500
11
12
13Threat AssessmentExposure Period Worst Case (in k)Achievable (in k)Best Case (in k)
14Risk NatureDescription RiskId RiskReasonTrend RiskCurrent Risk RatingStart Date RiskEnd Date RiskExposure QtrRevCost GM Impact Rev Cost GM Impact Rev Cost GM Impact
15ThreatTest 11HSE incident4Sep-22Oct-22Q3-2022600-600500-500500-500
16ThreatTest 22HSE incident1Sep-22Oct-22Q3-202220-2010-101005050
17ThreatTest 33HSE incident256Oct-22Nov-22Q4-202240-4030-3010-10
18OpportunityTest 44HSE incidentN256Sep-22Nov-22Q3-20225010401001090100100
19OpportunityTest 55HSE incident16Sep-22Nov-22Q3-2022501040601050 
20OpportunityTest 66HSE incident8Nov-22Nov-22Q4-2022201010201010 
21    -5050
22    -5050
23     
data
Cell Formulas
RangeFormula
M10M10=Z75
P13P13="Worst Case (in k)"
S13S13="Achievable (in k)"
V13V13="Best Case (in k)"
D15:D23D15=IF(ISBLANK($E15)," ",IFS($U15>0,"Opportunity",AND(R15>=0,U15=0,X15>0),"Opportunity",U15="","",$U15<=0,"Threat"))
O15:O23O15=IF(ISBLANK(M15),"",("Q"&ROUNDUP(MONTH(M15)/3,0)&"-"&YEAR(M15)))
R15:R23,X15:X23,U15:U23R15=P15-Q15
Cells with Conditional Formatting
CellConditionCell FormatStop If True
L15:L74Expression=AND($D15="Threat",$L15>0,$L15<9)textNO
M10Cell Value<0textNO
N10Cell Value<0textNO
L15:L74Expression=AND($D15="Threat",OR($L15=16,$L15=32))textNO
L15:L74Expression=AND($D15="Opportunity", $L15>=64,$L15<=256)textNO
L15:L74Expression=AND($D15="Opportunity",OR($L15=16,$L15=32))textNO
L15:L74Expression=AND($D15="Opportunity",$L15>1,$L15<9)textNO
L15:L74Expression=AND($D$15="Threat",OR($L15=64,,$L15=128,$L15=256))textNO
Cells with Data Validation
CellAllowCriteria
W2Custom=IF(DAY(W2+1)=1,TRUE,FALSE)
J15:J74List=#REF!$A$2:$A$30
K15:K74List=$N$80:$N$84
L15:L74List=$M$80:$M$88
M15:M19Custom=M15>$W$2
N15:N74Custom=N15>=M15
O15:O74Custom=AND(N15>$R$2,OR(AND(MONTH(O15)>MONTH(N15),O15>N15),AND(MONTH(O15)<=MONTH(N15),YEAR(O15)>YEAR(N15))))
M20:M74Any value
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
From what I can see, the values in cells B13 and C13 are correct with the formulas you're already using. What do you believe is wrong with those values?
 
Upvote 0
From what I can see, the values in cells B13 and C13 are correct with the formulas you're already using. What do you believe is wrong with those values?
Hi Kevin the problem comes if in the data sheet Column M the Exposure start date if this is not the 30th of each month then the values aren't summed in the Summary sheet. So I was trying to find if there was a way only to sum using the MMM-YY rather than it using the DD as well.
 
Upvote 0
Try this in B13:

Excel Formula:
=SUMIFS(data!$U$15:$U$20,data!$M$15:$M$20,"<="&EOMONTH(Summary!B11,0);data!$M$15:$M$20,">="&EOMONTH(B11,-1)+1)

/Skovgaard
 
Upvote 0
Solution
Hi Kevin the problem comes if in the data sheet Column M the Exposure start date if this is not the 30th of each month then the values aren't summed in the Summary sheet. So I was trying to find if there was a way only to sum using the MMM-YY rather than it using the DD as well.
Understood (y) The formula suggested by @Skovgaard will give you what you want - just watch that semi-colon before the last data! (should be a comma ;))
 
Upvote 0
Understood (y) The formula suggested by @Skovgaard will give you what you want - just watch that semi-colon before the last data! (should be a comma ;))


Thanks Kevin, not always easy to correct from semicolon to comma 👍😉

Below is corrected:

Excel Formula:
=SUMIFS(data!$U$15:$U$20,data!$M$15:$M$20,"<="&EOMONTH(Summary!B11,0),data!$M$15:$M$20,">="&EOMONTH(B11,-1)+1)

/Skovgaard
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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