Forum Discussion

BRW's avatar
BRW
Copper Contributor
Dec 28, 2025

Help with changing a formula

Hi - I am using a formula to sum hours worked for a week. Currently it calculating the values beginning on Sunday to Saturday. I would like to change it to sum from Monday to Sunday and display the result in column G on the Sunday of that week.  I'm hoping you can help me.  TIA

I am currently using the following formula.  

=IF(WEEKDAY(A2)=7, IF(SUMIFS(C:C,A:A, ">="&A2-6,A:A, "<="&A2)>0, SUMIFS(C:C,A:A, ">="&A2-6,A:A, "<="&A2), ""), "")

 ABCDEFGH
1Date HoursPurchasesRateDaily CostHrs / wk 
21-JanWed2.5 $20.00$50.00  
32-JanThu      
43-JanFri  $20.00   
54-JanSat3 $20.00$60.005.50 
65-JanSun  $20.00   
76-JanMon  $20.00   
87-JanTue  $20.00   
98-JanWed  $20.00   
109-JanThu  $20.00   
1110-JanFri  $20.00   
1211-JanSat3 $20.00$60.003.00 
1312-JanSun3 $20.00$60.00  
 

1 Reply

  • Lobo360's avatar
    Lobo360
    Brass Contributor

    I’ve answered more fully on your other post:

    Need assistance to correct a formula | Microsoft Community Hub

     

    But in relation to the specific point you mention in this one that “Currently it calculating the values beginning on Sunday to Saturday. I would like to change it to sum from Monday to Sunday”

    I think this would be because you haven’t used the optional second parameter of the Weekday function that defines which day of the week is 1 and which is 7.

    https://support.microsoft.com/en-us/office/weekday-function-60e44483-2ed1-439f-8bd0-e404c190949a

Resources