Sumif week number within a specific month

Tatum2020

New Member
Joined
Nov 25, 2020
Messages
37
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi everyone,

I hope you are keeping safe.
I am trying to calculate the revenue generated for a specific week based on monthly revenues. Is there a formula I can apply to do this? (i.e. I am trying to calculate the weekly revenue generated)

Input Table is set up like this:

Monthly revenue
Jan-21Feb-21
Joe1,0000.00
Ben4000.00
Kate200600
Sam7001,500

Output table:

Weeks12345
Monthly revenue
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Is there a formula I can apply to do this?
There is most probably one that you could use, but it will be specific to your requirement rather than a simple 'off the shelf' formula, we would need more (accurate) information in order to provide the correct one.

Are you saying that if a week consists if the last 3 days of Jan and first 4 days of Feb that the result should be (Jan revenue / 31) *3 + (Feb revenue / 28) * 4 ? If not then what should it be?

What should be the start and end point of the week for the purpose of the formula?

Which week numbering method should be used, (does week 1 start on Jan 1st, is it the first week that has 4 or more days in Jan, or something else)?
 
Upvote 0
There is most probably one that you could use, but it will be specific to your requirement rather than a simple 'off the shelf' formula, we would need more (accurate) information in order to provide the correct one.

Are you saying that if a week consists if the last 3 days of Jan and first 4 days of Feb that the result should be (Jan revenue / 31) *3 + (Feb revenue / 28) * 4 ? If not then what should it be?

What should be the start and end point of the week for the purpose of the formula?

Which week numbering method should be used, (does week 1 start on Jan 1st, is it the first week that has 4 or more days in Jan, or something else)?
Hi Jason,

Thank you for the response.

1. That is correct - it should be (Jan revenue / 31) *3 + (Feb revenue / 28) * 4
2. Start and endpoint should be Monday and Sunday
3. Week 1 should start on the 1st of January

I hope that answers your questions.
 
Upvote 0
I hope that answers your questions.
So just to clarify on point 3, week 1 for 2021 should only be 3 days (Friday - Sunday), and the last week of December should be 5 days (Dec 31 is a Friday)?

I'm going to be afk for the rest of the day, I expect that some of the other board regulars will pick up your thread before I return. I'll check when I return and post a formula for you if it has not already been resolved.
 
Upvote 0
I haven't forgotten about your question, this is proving more of a challenge than I first thought it would be.
 
Upvote 0
See if this will do what you need, note that it will not work if there are 2 rows with the same name in the input table.

This formula will only work with a recently updated version of office 365, it might be possible to reproduce the formula with older versions that don't have the functions used, but it would not be practical.

sumif weeknum.xlsx
ABCDEFGHIJK
1Monthly revenue
2Jan-21Feb-21
3Joe1,000-
4Ben400-
5Kate200600
6Sam7001,500
7
8
9Weeks12345678910
10Joe96.774194225.80645225.80645225.8065225.806500000
11Ben38.70967790.32258190.32258190.3225890.3225800000
12Kate19.35483945.1612945.1612945.1612945.161291501501501500
13Sam67.741935158.06452158.06452158.0645158.06453753753753750
Sheet6
Cell Formulas
RangeFormula
B9:BB9B9=SEQUENCE(,WEEKNUM(EOMONTH($B$2,11),2))
A10:A13A10=UNIQUE(A3:A6)
B10:K13B10=LET(s,$B$2,e,EOMONTH(s,1),q,SEQUENCE(e-s+1,,s),w,WEEKNUM(q,2),m,EOMONTH(q,-1)+1,d,DAY(EOMONTH(q,0)),r,INDEX($B$3:$C$6,MATCH($A10,$A$3:$A$6,0),0),SUMPRODUCT(($B$2:$C$2=m)*(B$9=w)*(r/d)))
Dynamic array formulas.
 
Upvote 0
Thank Jason, it worked
So just to clarify on point 3, week 1 for 2021 should only be 3 days (Friday - Sunday), and the last week of December should be 5 days (Dec 31 is a Friday)?

I'm going to be afk for the rest of the day, I expect that some of the other board regulars will pick up your thread before I return. I'll check when I return and post a formula for you if it has not already been resolved.
 
Upvote 0

Forum statistics

Threads
1,214,593
Messages
6,120,434
Members
448,961
Latest member
nzskater

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