should this formula work

jbrown021286

Board Regular
Joined
Mar 13, 2023
Messages
85
Office Version
  1. 365
Platform
  1. Windows
i am looking to make a formula that references a worksheet labeled aggregated data and i am wanting to add all the numbers in row 4 column c-ag if the date in the corresponding cells on row 3 are between the start of the week and today with the week starting on Sunday. this is the formula i have. any ideas on how to make it work. =SUMIFS('Aggregated Data'!C4:AG4,'Aggregated Data'!C3:AG3,".="&Date(year(Today()),Day(Today())-Weekday(Today(),1)+1),'Aggregated Data'!C3:AG3,"<="&Today())
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Try this:
(I used a testing day date instead of the TODAY() function, since today is Day 7 and all records would be selected.)
Also, i am unsure if you wanted consecutive dates in Row3, these are random, but the formula will work either way.

Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
1
2
3Testing DayWed 2024/01/10Fri 2024/01/12Thu 2024/01/04Sun 2024/01/07Fri 2024/01/12Sun 2024/01/07Tue 2024/01/02Tue 2024/01/02Mon 2024/01/08Sun 2024/01/07Sat 2024/01/13Fri 2024/01/05Tue 2024/01/02Mon 2024/01/08Fri 2024/01/05Tue 2024/01/09Fri 2024/01/05Thu 2024/01/04Sat 2024/01/13Mon 2024/01/15Tue 2024/01/09Wed 2024/01/10Sat 2024/01/13Mon 2024/01/01Tue 2024/01/09Mon 2024/01/08Wed 2024/01/10Thu 2024/01/11Mon 2024/01/01Tue 2024/01/09Tue 2024/01/09
42024-02-136274424498359836287959646982742
5
6100
Sheet5
Cell Formulas
RangeFormula
C6C6=SUM((WEEKDAY($C$3:$AG$3,1)<=WEEKDAY(A4,1))*($C$4:$AG$4))
 
Upvote 0
TECH HOURS WORKSHEET 2.0 tester.xlsx
ABCDEFGHIJKLMNOPQRSTUVWX
1Tech Hours
2 01FEB24 02FEB24 03FEB24 04FEB24 05FEB24 06FEB24 07FEB24 08FEB24 09FEB24 10FEB24 11FEB24 12FEB24 13FEB24 14FEB24 15FEB24 16FEB24 17FEB24 18FEB24 19FEB24 20FEB24 21FEB24 22FEB24
31-Feb2-Feb3-Feb4-Feb5-Feb6-Feb7-Feb8-Feb9-Feb10-Feb11-Feb12-Feb13-Feb14-Feb15-Feb16-Feb17-Feb18-Feb19-Feb20-Feb21-Feb22-Feb
4Jeff1015021.19.922.5 8.422.014.20.317.513.9 7.48.04.64.8       
5Justin1015492.020.04.0 6.510.45.25.23.013.8            
6Ramy10364211.26.23.5  15.15.09.411.69.5 1.415.811.09.6       
7Tuzzo1071327.17.48.9 10.53.53.911.23.95.0 2.32.88.88.0       
8Brandun107471 8.38.8 8.20.2     6.62.111.1        
9Carl1078012.6    7.42.84.20.340.0 2.07.79.93.0       
10Rod Jones1082283.83.43.0  5.11.92.54.60.5   0.82.5       
11Que 1082434.00.34.1 7.53.34.94.41.35.6 4.66.62.15.4       
12James1084104.66.510.1 7.16.92.64.95.96.3 10.20.57.210.8       
13Owens1086342.218.83.3   8.021.320.8  6.4 8.16.3       
14Hawk1095439.69.015.2 5.53.717.46.51.08.1 7.45.112.98.3       
15Josh1095729.211.8   9.39.511.57.314.1 1.012.413.26.0       
16David1097835.64.24.8 0.5  3.87.06.2 1.0  3.3       
17Angel10993010.83.61.0    6.114.111.2 9.71.16.98.6       
18Immanuel10210243.53.34.6 5.85.22.9-0.23.64.8 6.16.72.0        
19Jamie10210253.12.92.1  1.72.23.22.63.8 0.34.91.73.6       
20Peter10210261.32.02.6 3.9 0.5    3.4 5.2        
21Frederick10210279.47.47.1 9.811.1 1.212.66.8 0.74.7 12.0       
22Jerusha10210282.82.31.0 2.31.41.93.9 3.8 3.41.6 1.4       
23Gerrardo 1021029 3.32.9 4.12.42.9 3.47.2 4.93.81.9        
24Tre10210324.33.44.0  1.83.82.46.13.1 0.35.03.42.2       
25Harry10210370.52.50.9 1.9 3.23.33.53.2 2.2 3.11.0       
26Contrer1021038  1.5 0.81.01.41.9              
27Trevin10210392.12.22.2 1.12.7 2.72.62.9 2.23.7 2.8       
28Venro10210400.55.514.6  9.04.25.12.64.1 13.8 2.210.5       
29BlankBlank                      
30BlankBlank                      
Aggregated Data
Cell Formulas
RangeFormula
C4:C30C4=SUMIFS(RTH!$N:$N,RTH!$E:$E,'Aggregated Data'!B4,RTH!$B:$B,$C$2)
D4:D30D4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,$D$2)
E4:E30E4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,$E$2)
F4:F30F4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,$F$2)
G4:G30G4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,$G$2)
H4:H30H4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,H$2)
I4:I30I4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,I$2)
J4:J30J4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,J$2)
K4:K30K4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,K$2)
L4:L30L4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,L$2)
M4:M30M4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,M$2)
N4:N30N4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,N$2)
O4:O30O4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,O$2)
P4:P30P4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,P$2)
Q4:Q30Q4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,Q$2)
R4:R30R4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,R$2)
S4:S30S4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,S$2)
T4:T30T4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,T$2)
U4:U30U4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,U$2)
V4:V30V4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,V$2)
W4:W30W4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,W$2)
X4:X30X4=SUMIFS(RTH!$N:$N,RTH!$E:$E,B4,RTH!$B:$B,X$2)



this is the sheet that i am referencing



TECH HOURS WORKSHEET 2.0 tester.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAAB
12/17/2024
2
3Week to Date
4
5
610150210154910364210713210747110780110822810824310841010863410954310957210978310993010210241021025102102610210271021028102102910210321021037102103810210391021040
7JeffJustinRamyTuzzoBrandunCarlRod JonesQue JamesOwensHawkJoshDavidAngelImmanuelJamiePeterFrederickJerushaGerrardo TreHarryContrerTrevinVenro
8hours134.6
9
10
Hours
Cell Formulas
RangeFormula
A1A1=TODAY()
C8C8=SUM((WEEKDAY('Aggregated Data'!C3:AG3,1)<=WEEKDAY(A1,1))*('Aggregated Data'!C4:AG4))


and this is the sheet i am wanting the output in. for some reason it is totaling the entire row for me not just the current week
 
Upvote 0
Well, you're formula is results in every day in the range C3:AG3 being selected. You are asking for a weekday function which with option 1 is a Sunday to Monday week, with Sunday being 1 and Saturday being 7. Today (Feb 17) is a Saturday. So every value in the expression Weekday(C2:AG3,1) is a number 1 thru 7, and your comparing it to Weekday(Saturday Feb 17, 2024,1) which resolves to 7. So you have all TRUES and all data on row C4:AG4 will be returned to the SUM() function.
And, as I see in you mini worksheet you posted (thank you for doing that!) you have a heading called "Week To Date". So, you really needed a different approach, your OP says Days since Sunday, not Days Since Sunday of the target date (which is Today() so the current week).

And I cannot replicate your Aggregate Data values because you have formulas on that worksheet that refer to a sheet called RTH or something. So, I'll use dummy data.
Also, I could not use all of your names, it made the file too big to past as an xl2bb.
You'll notice I have a validation conditional formatting, and only two rows are green that is because I only summed the 7 days (2/11 thru 2/18) to get compare to the new calculation, and both of those are using 2/17/2024 as the date. After 2/17, the first row that is using the TODAY() function will return a date in a new week begining tomorrow.

I hope I have covered the question.


Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZAA
1Today:Sat 2024-02-17
2
3JeffJustinRamyTuzzoBrandunCarlRod JonesQue JamesOwens
4101502101549103642107132107471107801108228108243108410108634
5Using TODAY() in Cell B1: >>>36.8068.0061.9041.1057.5045.0065.8039.8076.8046.90
6Testing Date:Pior Sunday
7Thu 2024-02-08Sun 2024-02-0430.0045.6035.9052.4038.0034.4039.3058.5054.0028.20
8Fri 2024-02-09Sun 2024-02-0430.4051.9048.7062.4044.4040.2054.6058.5054.6034.50
9Sat 2024-02-10Sun 2024-02-0435.3060.9053.6065.1048.5051.7062.3073.9068.7039.20
10Sun 2024-02-11Sun 2024-02-1111.3015.502.0013.106.4010.3011.6011.0015.108.50
11Mon 2024-02-12Sun 2024-02-1121.1027.406.5015.0020.1021.7020.8011.0029.0022.00
12Tue 2024-02-13Sun 2024-02-1122.5034.8021.7016.2028.4021.7029.7024.5040.7022.60
13Wed 2024-02-14Sun 2024-02-1123.2038.3029.4030.3032.7030.3041.3032.1053.6025.20
14Thu 2024-02-15Sun 2024-02-1127.8039.6044.4031.7040.1037.7049.3032.1064.2033.80
15Fri 2024-02-16Sun 2024-02-1134.9053.0049.9037.7043.7038.1052.0036.5069.7044.90
16Sat 2024-02-17Sun 2024-02-1136.8068.0061.9041.1057.5045.0065.8039.8076.8046.90
17Sun 2024-02-18Sun 2024-02-184.6010.503.807.0011.200.003.4012.500.909.30
18Mon 2024-02-19Sun 2024-02-1813.9021.205.8010.0022.009.605.3013.3015.4022.00
19Tue 2024-02-20Sun 2024-02-1823.1022.3019.9024.8022.5024.406.0029.0031.2033.70
20Wed 2024-02-21Sun 2024-02-1827.9025.0031.0033.7036.7025.1018.9037.5045.3042.30
21
22
23Tech Hours
24ThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayFridaySaturdaySundayMondayTuesdayWednesdayThursdayW/B 2/11 To Date
252024-02-012024-02-022024-02-032024-02-042024-02-052024-02-062024-02-072024-02-082024-02-092024-02-102024-02-112024-02-122024-02-132024-02-142024-02-152024-02-162024-02-172024-02-182024-02-192024-02-202024-02-212024-02-22
26Jeff1015029.3114.512.121.42.412.10.44.911.39.81.40.74.67.11.94.69.39.24.813.736.8
27Justin1015499.52.11511.53.811.5810.86.3915.511.97.43.51.313.41510.510.71.12.78.768
28Ramy1036428.30.56.52.10.45.313.314.812.84.924.515.27.7155.5123.8214.111.11361.9
29Tuzzo10713210.71.415.6515.215.411.55.3102.713.11.91.214.11.463.47314.88.911.841.1
30Brandun1074718.88.610.89.86.44.16.413.78.34.37.43.613.811.210.80.514.211.257.5
31Carl10780115.811.57.15.811.510.311.48.67.40.46.99.614.80.71.245
32Rod Jones10822815.75.56.711.415.37.711.69.28.911.682.713.83.41.90.712.96.565.8
33Que 1082431.47.67.615.43.515.811.612.215.41113.57.64.43.312.50.815.78.51.739.8
34James10841012.112.98.115.415.210.912.50.614.115.113.911.712.910.65.57.10.914.515.814.17.276.8
35Owens10863410.59.59.87.51.46.34.78.513.50.62.68.611.129.312.711.78.61146.9
Aggregated Data
Cell Formulas
RangeFormula
B1B1=TODAY()
C3:L4C3=TRANSPOSE(A26:B35)
C5:L5C5=SUM( ($B$1>=$C$25:$X$25)* (WORKDAY.INTL($B$1+1,-1,"1111110")<=$C$25:$X$25)* ($B$26:$B$35=C$4)* ($C$26:$X$35))
B7:B20B7=WORKDAY.INTL($A7+1,-1,"1111110")
C7:L20C7=SUM( ($A7>=$C$25:$X$25)* (WORKDAY.INTL($A7+1,-1,"1111110")<=$C$25:$X$25)* ($B$26:$B$35=C$4)* ($C$26:$X$35))
A8:A20A8=A7+1
Z26:Z35Z26=SUM(M26:S26)
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C5:L20Expression=XLOOKUP(C$4,$B$26:$B$35,$Z$26:$Z$35,0)<>C5textNO
C5:L20Expression=XLOOKUP(C$4,$B$26:$B$35,$Z$26:$Z$35,0)=C5textNO
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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