Help with formula to sum numbers prior to date

ExcelAtEverything

Active Member
Joined
Jan 30, 2021
Messages
308
Office Version
  1. 2019
Platform
  1. Windows
Hello,

I was hoping to get some assistance as I'm having trouble with this. Using my table below as an example, how could I write a formula which will basically say:

* For each store, add all monthly dollar amounts for months that occur prior to the month of the "Reporting Date" in $B$2. (or in this case, Jan & Feb)

*For the month in the table which is equal to the "Reporting Date" in $B$2 (in this case, March), I would like to take the daily average of the dollar amount shown for that month (divided evenly by # days in that month (in this case 31)), and multiply by the number of days that have passed so far in the "Reporting Date" $B$2 (specifically up to but not including the "Reporting Date"). In other words using the displayed table, for the month of March (since that's a partial month due to the "Reporting Date"), Instead of entering $100, I would only enter $87.21 (since that is an estimated amount based on the "Reporting Date".

Thank you.

1617963238870.png
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
58,135
Office Version
  1. 365
Platform
  1. Windows
Oops, I didn't look at the formula Snakehips supplied, the headers need to be the end of the month, not the 1st.
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK

ExcelAtEverything

Active Member
Joined
Jan 30, 2021
Messages
308
Office Version
  1. 2019
Platform
  1. Windows
Ok. But this makes me have to ask a different question before I do so. If this table is popuated by data from a data model, and I refresh the data daily after adding new excel docs into my folders, will that erase any header formatting that I would have in this table? Or will the data just fill in around whatever formatting I have?
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
58,135
Office Version
  1. 365
Platform
  1. Windows
I've no idea, I've never used data models.
 

Snakehips

Well-known Member
Joined
May 17, 2009
Messages
5,224
Office Version
  1. 2013
Platform
  1. Windows

ADVERTISEMENT

In order for us to provide a modified solution that, hopefully, would work we will need to know more detail of the data that you are using.
Eg.
The reporting date is a manually entered date?
The Headers in D:O are text, always Jan to Dec of the year of the reporting date?
If necessary, can you tolerate having a 'Helper' row in say row 2 ?
 

ExcelAtEverything

Active Member
Joined
Jan 30, 2021
Messages
308
Office Version
  1. 2019
Platform
  1. Windows
The reporting date is a manually entered date?
The Headers in D:O are text, always Jan to Dec of the year of the reporting date?
If necessary, can you tolerate having a 'Helper' row in say row 2 ?
Yes, manually entered.
Yes text, yes always Jan to Dec. But no, not always same as year of reporting date. Most of time yes, but not always.
I don't mind the helper column in row 2 at all.
 

ExcelAtEverything

Active Member
Joined
Jan 30, 2021
Messages
308
Office Version
  1. 2019
Platform
  1. Windows

ADVERTISEMENT

Basically these numbers are fake just so I could get an example to you. But this will be a table full of plan/budget numbers for each month. It comes out at the start of each year and will be updated at that time via Power Query connection. I'm using the table and the numbers within it to determine the percentage of budget that a store sold each day/month. That's why I need the estimated daily numbers... so that I can compare against the daily sales numbers This particular issue is related to how a store is doing year-to-date. But since there are only monthly budget numbers.... you get it.
 

Andy Pilkington

Board Regular
Joined
Jan 23, 2014
Messages
65
Office Version
  1. 2019
Platform
  1. Windows
Hi, does the attached spreadsheet work for you?

Book2.xlsx
ABCDEFGHIJKLMNOPQRS
2
3Reporting Date:
428/03/2020Results up to Reporting Date
5
6StoreJanFebMarAprMayJunJulAugSepOctNovDecTotals
7Loc 1100.00150.00100.00150.00150.00160.00170.00180.00190.00200.00210.00220.001,980.00340.32
8Loc 2200.00250.00200.00250.00250.00260.00270.00280.00290.00300.00310.00320.003,180.00630.65
9Loc 3300.00350.00300.00350.00350.00360.00370.00380.00390.00400.00410.00420.004,380.00920.97
10Loc 4400.00450.00400.00450.00450.00460.00470.00480.00490.00500.00510.00520.005,580.001,211.29
11Loc 5500.00550.00500.00550.00550.00560.00570.00580.00590.00600.00610.00620.006,780.001,501.61
12Loc 6600.00650.00600.00650.00650.00660.00670.00680.00690.00700.00710.00720.007,980.001,791.94
13
14
Sheet1
Cell Formulas
RangeFormula
I7:O12I7=H7+10
P7:P12P7=SUM(D7:O7)
F7:F12F7=D7
R7:R12R7=SUM(Sheet2!D14:O14)
 

ExcelAtEverything

Active Member
Joined
Jan 30, 2021
Messages
308
Office Version
  1. 2019
Platform
  1. Windows
Hi thanks Andy. I must be missing something. Is there more to the formula? That formula wouldn't allow the date specificity I'm looking for. Is there something I'm not seeing?
 

Andy Pilkington

Board Regular
Joined
Jan 23, 2014
Messages
65
Office Version
  1. 2019
Platform
  1. Windows
The formulas are on another sheet. The mini sheet I uploaded was first of all to see if it gave the results you are looking for. If it does I can share the other worksheet.
 

Watch MrExcel Video

Forum statistics

Threads
1,132,640
Messages
5,654,537
Members
418,138
Latest member
agnesegras

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
Top