Hi Excel Peoples
I've got a table with dates as headers and I want to sum up the values under those dates depending if they fell under this week or last week.
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>[TABLE="width: 0"]
<colgroup><col style="width: 100px"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"></colgroup><tbody>[TR]
[TD="align: right"]9/6/19[/TD]
[TD="align: right"]9/7/19[/TD]
[TD="align: right"]9/8/19[/TD]
[TD="align: right"]9/9/19[/TD]
[TD="align: right"]9/10/19[/TD]
[TD="align: right"]9/11/19[/TD]
[TD="align: right"]9/12/19[/TD]
[TD="align: right"]9/13/19[/TD]
[TD="align: right"]9/14/19[/TD]
[TD="align: right"]9/15/19[/TD]
[TD="align: right"]9/16/19[/TD]
[TD="align: right"]9/17/19[/TD]
[TD="align: right"]9/18/19[/TD]
[TD="align: right"]9/19/19[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B7E1CD]#B7E1CD[/URL] , align: right"]9/20/19[/TD]
[TD="align: right"]9/21/19[/TD]
[TD="align: right"]9/22/19[/TD]
[TD="align: right"]9/23/19[/TD]
[TD="align: right"]9/24/19[/TD]
[TD="align: right"]9/25/19[/TD]
[/TR]
[TR]
[TD="align: right"]127669332[/TD]
[TD="align: right"]148322320[/TD]
[TD="align: right"]149918866[/TD]
[TD="align: right"]92137347[/TD]
[TD="align: right"]40431402[/TD]
[TD="align: right"]140510929[/TD]
[TD="align: right"]155523745[/TD]
[TD="align: right"]16931759[/TD]
[TD="align: right"]12576337[/TD]
[TD="align: right"]182077049[/TD]
[TD="align: right"]82210390[/TD]
[TD="align: right"]26796816[/TD]
[TD="align: right"]19020423[/TD]
[TD="align: right"]22955150[/TD]
[TD="align: right"]47476811[/TD]
[TD="align: right"]76528476[/TD]
[TD="align: right"]21883809[/TD]
[TD="align: right"]34201369[/TD]
[TD="align: right"]36850047[/TD]
[TD="align: right"]67595049[/TD]
[/TR]
</tbody>[/TABLE]
If I create new rows that use Weeknum() to specify that weeknum value for the date in question and the current date the sumif works fine
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>[TABLE="width: 0"]
<colgroup><col style="width: 137px"><col width="150"><col width="182"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD="align: right"]9/6/19[/TD]
[TD="align: right"]9/7/19[/TD]
[TD="align: right"]9/8/19[/TD]
[TD="align: right"]9/9/19[/TD]
[TD="align: right"]9/10/19[/TD]
[TD="align: right"]9/11/19[/TD]
[TD="align: right"]9/12/19[/TD]
[TD="align: right"]9/13/19[/TD]
[TD="align: right"]9/14/19[/TD]
[TD="align: right"]9/15/19[/TD]
[TD="align: right"]9/16/19[/TD]
[TD="align: right"]9/17/19[/TD]
[TD="align: right"]9/18/19[/TD]
[TD="align: right"]9/19/19[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B7E1CD]#B7E1CD[/URL] , align: right"]9/20/19[/TD]
[TD="align: right"]9/21/19[/TD]
[TD="align: right"]9/22/19[/TD]
[TD="align: right"]9/23/19[/TD]
[TD="align: right"]9/24/19[/TD]
[TD="align: right"]9/25/19[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="align: right"]127669332[/TD]
[TD="align: right"]148322320[/TD]
[TD="align: right"]149918866[/TD]
[TD="align: right"]92137347[/TD]
[TD="align: right"]40431402[/TD]
[TD="align: right"]140510929[/TD]
[TD="align: right"]155523745[/TD]
[TD="align: right"]16931759[/TD]
[TD="align: right"]12576337[/TD]
[TD="align: right"]182077049[/TD]
[TD="align: right"]82210390[/TD]
[TD="align: right"]26796816[/TD]
[TD="align: right"]19020423[/TD]
[TD="align: right"]22955150[/TD]
[TD="align: right"]47476811[/TD]
[TD="align: right"]76528476[/TD]
[TD="align: right"]21883809[/TD]
[TD="align: right"]34201369[/TD]
[TD="align: right"]36850047[/TD]
[TD="align: right"]67595049[/TD]
[/TR]
[TR]
[TD]Date in Data[/TD]
[TD="bgcolor: #FFFF00"]=WEEKNUM(B4)[/TD]
[TD="align: right"]36[/TD]
[TD="align: right"]36[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]39[/TD]
[TD="align: right"]39[/TD]
[TD="align: right"]39[/TD]
[TD="align: right"]39[/TD]
[/TR]
[TR]
[TD]Today[/TD]
[TD="bgcolor: #FFFF00"]=WEEKNUM(TODAY())[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Last week[/TD]
[TD="bgcolor: #FFFF00"]=sumif(E6:X6,E7-1,E5:X5)[/TD]
[TD="align: right"]608030385[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I'm trying to make the formula more efficient and eliminate the need to create more rows of data I only need temporarily. I've tried the following but neither work.
=sumif(E4:X4,Weeknum(4:4)=Weeknum(TODAY()),E5:X5) results in = 0
=sumif(Weeknum(E4:X4),Weeknum(TODAY()),E5:X5) results in = 0
Any recommendations on how to tweak this so it functions as expected?
Thanks
I've got a table with dates as headers and I want to sum up the values under those dates depending if they fell under this week or last week.
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>[TABLE="width: 0"]
<colgroup><col style="width: 100px"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"></colgroup><tbody>[TR]
[TD="align: right"]9/6/19[/TD]
[TD="align: right"]9/7/19[/TD]
[TD="align: right"]9/8/19[/TD]
[TD="align: right"]9/9/19[/TD]
[TD="align: right"]9/10/19[/TD]
[TD="align: right"]9/11/19[/TD]
[TD="align: right"]9/12/19[/TD]
[TD="align: right"]9/13/19[/TD]
[TD="align: right"]9/14/19[/TD]
[TD="align: right"]9/15/19[/TD]
[TD="align: right"]9/16/19[/TD]
[TD="align: right"]9/17/19[/TD]
[TD="align: right"]9/18/19[/TD]
[TD="align: right"]9/19/19[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B7E1CD]#B7E1CD[/URL] , align: right"]9/20/19[/TD]
[TD="align: right"]9/21/19[/TD]
[TD="align: right"]9/22/19[/TD]
[TD="align: right"]9/23/19[/TD]
[TD="align: right"]9/24/19[/TD]
[TD="align: right"]9/25/19[/TD]
[/TR]
[TR]
[TD="align: right"]127669332[/TD]
[TD="align: right"]148322320[/TD]
[TD="align: right"]149918866[/TD]
[TD="align: right"]92137347[/TD]
[TD="align: right"]40431402[/TD]
[TD="align: right"]140510929[/TD]
[TD="align: right"]155523745[/TD]
[TD="align: right"]16931759[/TD]
[TD="align: right"]12576337[/TD]
[TD="align: right"]182077049[/TD]
[TD="align: right"]82210390[/TD]
[TD="align: right"]26796816[/TD]
[TD="align: right"]19020423[/TD]
[TD="align: right"]22955150[/TD]
[TD="align: right"]47476811[/TD]
[TD="align: right"]76528476[/TD]
[TD="align: right"]21883809[/TD]
[TD="align: right"]34201369[/TD]
[TD="align: right"]36850047[/TD]
[TD="align: right"]67595049[/TD]
[/TR]
</tbody>[/TABLE]
If I create new rows that use Weeknum() to specify that weeknum value for the date in question and the current date the sumif works fine
<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>[TABLE="width: 0"]
<colgroup><col style="width: 137px"><col width="150"><col width="182"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"><col width="100"></colgroup><tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD="align: right"]9/6/19[/TD]
[TD="align: right"]9/7/19[/TD]
[TD="align: right"]9/8/19[/TD]
[TD="align: right"]9/9/19[/TD]
[TD="align: right"]9/10/19[/TD]
[TD="align: right"]9/11/19[/TD]
[TD="align: right"]9/12/19[/TD]
[TD="align: right"]9/13/19[/TD]
[TD="align: right"]9/14/19[/TD]
[TD="align: right"]9/15/19[/TD]
[TD="align: right"]9/16/19[/TD]
[TD="align: right"]9/17/19[/TD]
[TD="align: right"]9/18/19[/TD]
[TD="align: right"]9/19/19[/TD]
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=B7E1CD]#B7E1CD[/URL] , align: right"]9/20/19[/TD]
[TD="align: right"]9/21/19[/TD]
[TD="align: right"]9/22/19[/TD]
[TD="align: right"]9/23/19[/TD]
[TD="align: right"]9/24/19[/TD]
[TD="align: right"]9/25/19[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD="align: right"]127669332[/TD]
[TD="align: right"]148322320[/TD]
[TD="align: right"]149918866[/TD]
[TD="align: right"]92137347[/TD]
[TD="align: right"]40431402[/TD]
[TD="align: right"]140510929[/TD]
[TD="align: right"]155523745[/TD]
[TD="align: right"]16931759[/TD]
[TD="align: right"]12576337[/TD]
[TD="align: right"]182077049[/TD]
[TD="align: right"]82210390[/TD]
[TD="align: right"]26796816[/TD]
[TD="align: right"]19020423[/TD]
[TD="align: right"]22955150[/TD]
[TD="align: right"]47476811[/TD]
[TD="align: right"]76528476[/TD]
[TD="align: right"]21883809[/TD]
[TD="align: right"]34201369[/TD]
[TD="align: right"]36850047[/TD]
[TD="align: right"]67595049[/TD]
[/TR]
[TR]
[TD]Date in Data[/TD]
[TD="bgcolor: #FFFF00"]=WEEKNUM(B4)[/TD]
[TD="align: right"]36[/TD]
[TD="align: right"]36[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]37[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]39[/TD]
[TD="align: right"]39[/TD]
[TD="align: right"]39[/TD]
[TD="align: right"]39[/TD]
[/TR]
[TR]
[TD]Today[/TD]
[TD="bgcolor: #FFFF00"]=WEEKNUM(TODAY())[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[TD="align: right"]38[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]Last week[/TD]
[TD="bgcolor: #FFFF00"]=sumif(E6:X6,E7-1,E5:X5)[/TD]
[TD="align: right"]608030385[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
I'm trying to make the formula more efficient and eliminate the need to create more rows of data I only need temporarily. I've tried the following but neither work.
=sumif(E4:X4,Weeknum(4:4)=Weeknum(TODAY()),E5:X5) results in = 0
=sumif(Weeknum(E4:X4),Weeknum(TODAY()),E5:X5) results in = 0
Any recommendations on how to tweak this so it functions as expected?
Thanks