Count days with specific balance

PAOLO7673

New Member
Joined
Jul 4, 2024
Messages
12
Office Version
  1. 2019
Platform
  1. Windows
Hi everyone.
I need to count the number of days reaching a specific bank balance.
In Colum A the dates are listed, repeated dates as well
In Colum B the running balance with positive and negatives amounts.
I want to know how many days the negative balance occurred in a year( specified in a cell)
eg: in 2023 the balance below $1000 lasted 13 days.
Many thanks for helps.
paolo
 
@PAOLO7673 Please check, Note: Date format "MMDDYY"
Book2
ABCDEFGHIJ
1DATEAMT IN/OUTBALANCEDAYS Negative BALManual Result
201/01/2250400year2023146
301/03/22-600-20022balance limit<=0
401/04/224002000
501/04/225007000
601/05/2260013000
701/06/22-1400-10011
801/07/222501500
901/08/22502000
1001/09/221003000
1101/09/22503500
1201/11/23-500-1500
1302/02/23100-502222
1402/05/2350033
1506/01/23-200-200116116
1606/06/23200055
1711/30/231001000
1811/30/232003000
1911/30/233506500
2011/30/2360012500
2112/31/23-10002500
2201/01/24-500-25011
2301/02/246003500
2401/03/243006500???
2501/03/242509000???
2601/03/24-2000-110011???
2712/01/24150-950333333
2812/01/24100-85000
2912/31/2450-8003030
3012/31/24800000
Sheet1
Cell Formulas
RangeFormula
J2J2=IFERROR(MAX(FILTER($A$2:$A$30,($D$2:$D$30<=0)*(YEAR($A$2:$A$30)=$I$2)))-MIN(FILTER($A$2:$A$30,($D$2:$D$30<=0)*(YEAR($A$2:$A$30)=$I$2))),0)
Thak you Sam, but my excel version doesnt accept the filter function. Is there any other way?
 
Upvote 0
Please try this,
Excel Formula:
=IFERROR(MAX(IF(($D$2:$D$30<=0)*(YEAR($A$2:$A$30)=$I$2), $A$2:$A$30)) - MIN(IF(($D$2:$D$30<=0)*(YEAR($A$2:$A$30)=$I$2), $A$2:$A$30)), 0)
 
Upvote 0

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