Sumifs and subtotal (or not)?

deLockloire

Board Regular
Joined
Apr 4, 2008
Messages
110
Office Version
  1. 365
Platform
  1. Windows
I have a table with 3 columns: transaction date, costs/revenues, tax/deductable tax. Each row is one revenue or cost and the dates goes on multi-year seamlessly (i.e., I have a table that has this from 2019). What I'd like is to give a date in a cell (say A1), and have a formula that outputs a special sumif in b1 with the following rule:

1) it should sum all costs/revenues up to the date given in A1. (easy, simple sumif function, however...)
2) it should sum all tax/dedutcable tax as well up to the date indicated in A1, but the trick here is that this column should be evaluated separately for each year, and it cannot go below 0 in any given year. So if, say, in 2019 the sum of all revenues/costs is 10,000, the sum of all tax/deductables is 1000, and in 2020 the revenues are 100 and the taxes/deductables are -300, and the date is indicated in A1 is 2020.12.31, it should output 11,100 (10,000+1,000 for 2019 and 100+0 for 2020).

Is there a formula to solve this? Some form of subtotal or something?

Thanks for the tips!
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
it would really help if you could post a mini workbook that the forum can copy and paste and work with the data. You can anonymize it if needed.
 
Upvote 0
yeah, i tried to build what you're asking, but I have no clue. Care to give better examples? Maybe use the xl2bb add in to give us what you actually have to work with?

Book1
BCDEFMNO
13
14rev/costsTax/Dedtransaction datecosts/revenuestax/deductable tax
1520191000010002020-03-10-100-100
162020100-300111002019-02-03200-200
172021-08-1900
182019-10-18-300-200
192023-09-10300-100
202021-08-27-300-200
212019-03-11-300-100
222019-10-13200-200
232022-08-06-1000
242023-01-06-3000
252020-01-031000
262019-02-22200-200
272022-03-27-2000
282021-07-14-300-100
292023-02-23100-200
302019-08-03300-200
312019-09-20100-100
322023-11-22-100-200
332023-09-04200-200
342022-06-08-1000
35
Sheet2
 
Upvote 0

Forum statistics

Threads
1,214,780
Messages
6,121,527
Members
449,037
Latest member
tmmotairi

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