Cost/Month based on a range

inactiveUser462638

New Member
Joined
Jun 13, 2020
Messages
13
Office Version
  1. 2016
Platform
  1. Windows
Hello Excel Champs!

Please help me to find the right formula for calculating the cost/month/day based on a range.

I have data like that:

P&L.xlsx
ABCDEFGH
1Inflow/OutflowElement TypeElement DescriptionStarting dateEnd DateVendor / CustomerGross AmountPaying Entity
2OutflowHR CostPhil27-Jan16-AugBob100.00
3InflowBAUGB15/09/201915/02/2020GB25
4InflowBAUGB211/09/201915/01/2020GB1500….
P&L Elements


And I have to generate in a new sheet the cost/month based on a date range and to check if this is an Inflow or an Outflow:

P&L.xlsx
ABCDEFGHIJKLMNO
2P&L OverviewJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecemberJanuary2February3
3Inflow00000000000000
4Outflow00000000000000
5Gross Profit00000000000000
P&L Report
Cell Formulas
RangeFormula
B3:O3B3=SUMIFS('P&L Elements'!$G:$G,'P&L Elements'!$A:$A,"Inflow",'P&L Elements'!$D:$D,'P&L Report'!B2)
B4:O4B4=SUMIFS('P&L Elements'!$G:$G,'P&L Elements'!$A:$A,"Outflow",'P&L Elements'!$D:$D,'P&L Report'!B2)
B5:O5B5=B3-B4


So I have to generate into the January column the total amount of Inflow items/Outflow Items on that month but because I have a Starting Date and an End Date I have to split the amount/day for each item and then to sum the others Inflow/Outflow items that are in the January month (01/01/2020-31/01/2020).

Do you have any idea how I can calculate that?

Thank you!
 
Last edited by a moderator:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi Sergiu,

You need a few modifications

1- From (P&L Report) sheet, type 01/01/2019 in cell B2, 01/02/2019 in cell C2 and drag it till cell O2
2- Select range B2:O2, press Ctrl+1 >> Customs >> select mmm-yy

And then, try the following modified formula, please:
=SUMIFS('P&L Elements'!$G:$G,'P&L Elements'!$A:$A,"Inflow",Month('P&L Elements'!$D:$D),Month('P&L Report'!B2))
=SUMIFS('P&L Elements'!$G:$G,'P&L Elements'!$A:$A,"Outflow",Month('P&L Elements'!$D:$D),Month('P&L Report'!B2))

Let me know

Best Regards
M. Yusuf
 
Upvote 0
Correction, below are the correct formulas

=SUMIFS('P&L Elements'!$G:$G,'P&L Elements'!$E:$E,">="&B1,'P&L Elements'!$E:$E,"<="&EOMONTH(B1,0),'P&L Elements'!$A:$A,"Inflow")
=SUMIFS('P&L Elements'!$G:$G,'P&L Elements'!$E:$E,">="&B1,'P&L Elements'!$E:$E,"<="&EOMONTH(B1,0),'P&L Elements'!$A:$A,"Outflow")
 
Upvote 0
Hello @mamady !

Thanks for your help but unfortunately I need the calculation to be made splitting the Gross Amount/day and the Inflow/Outflow amount to be calculated summing up the partial month amount that is included in the date ranges from P&L Elements and then to show in the P&L Report the results/month.
 
Upvote 0

Forum statistics

Threads
1,214,665
Messages
6,120,801
Members
448,992
Latest member
rohitsomani

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