FORMULA HELP! (SUM between two cells)

larinda4

Board Regular
Joined
Nov 15, 2021
Messages
74
Office Version
  1. 365
Platform
  1. Windows
I've been racking my brain trying to figure out a formula for this. I've included borders to help illustrate what I need.

I'm trying to sum column P based on the month in Q and subtract it from the debited amount in column S to get my monthly total in column T. I tried doing a SUMIF but as you'll see from the screenshot below, it won't calculate because there's a month for October and not November on the left and on the right, there's November and no October. Columns O and R are helper columns I created, but clearly it isn't working.

Generally there are more blank rows on the left hand side, but I figured this would make it easier. The start of the month on the left hand side will always be the same row on the right hand side. .

How can I sum this based on the month but also taking into account if the prior month is missing and adding it to the calculation?

1671220049019.png
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
I'm trying to sum column P based on the month in Q and subtract it from the debited amount in column S
If you already have the date in column Q, check the following proposal. I am taking column R as a helper column to fill in the dates from column Q.
In column T are the totals using column R as a reference to calculate.

NOTE XL2BB:
For the future, it would help greatly if you could give us the sample data in a form that we can copy to test with, rather that a picture.
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in
Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.

Example:
Dante Amor
PQRST
1CreditedMonthDateDebitedMonthly Total
2
3
4315/nov/202115/nov/2021(147)
515/nov/2021150 
6415/dic/202115/dic/2021200(84)
711215/dic/2021 
8515/ene/202215/ene/2022215126
915015/ene/2022 
1018615/ene/2022 
111015/feb/202215/feb/2022300(284)
12615/feb/2022 
13715/mar/202215/mar/202247590
141015/mar/2022 
1554815/mar/2022 
16415/abr/202215/abr/202242596
171515/abr/2022 
1850215/abr/2022 
1915/may/202215/may/2022600(59)
201415/may/2022 
2152715/may/2022 
224215/jun/202215/jun/2022650(570)
233815/jun/2022 
2477815/jul/202215/jul/2022425385
253215/jul/2022 
26515/ago/202215/ago/202292635
2790415/ago/2022 
285215/ago/2022 
2947215/sep/202215/sep/2022664(170)
302215/sep/2022 
3115/sep/2022 
32715/oct/202215/oct/2022247(171)
336915/oct/2022 
Hoja8
Cell Formulas
RangeFormula
R4:R33R4=IF(Q4<>"",Q4,R3)
T4:T33T4=IF(Q4<>"",SUMIF(R:R,Q4,P:P)-SUMIF(R:R,Q4,S:S),"")
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,138
Members
453,021
Latest member
Justyna P

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