Count (countifs) norm exceedances with variable dates and variable norms formula or VBA

FallenFire

New Member
Joined
Apr 14, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hey everyone,

I have substance measurement data from water quality checks.

The data is listed in a table starting with the date (dd/mm/yyyy).
Above the table are the norms. The variable norms are in green. Those norms are generated on a second tab, and change (sort of) weekly.
I need to count the norm exceedances by year. But those depend on the dates and the corresponding norms, which are added on in the second tab.
A norm exceedance is defined in two ways:
- everything above the norm if 'schepstaal'
- everything above the norm+30% if 'D'

I have a countifs formula for the fixed norms but not for the variable ones. (I normally hide the count if rows)
eg: =COUNTIFS(Table128383941[[Datum]:[Datum]];">=01/01/2022";Table128383941[[Datum]:[Datum]];"<=31/12/2022";Table128383941[BZV (mg/l)];">"&F11)
eg: =COUNTIFS(Table128383941[[Datum]:[Datum]];">=01/01/2022";Table128383941[[Datum]:[Datum]];"<=31/12/2022";Table128383941[[Soort staalname]:[Soort staalname]];"=schepstaal";Table128383941[BZV (mg/l)];">="&2*F11)+COUNTIFS(Table128383941[[Datum]:[Datum]];">=01/01/2022";Table128383941[[Datum]:[Datum]];"<=31/12/2022";Table128383941[[Soort staalname]:[Soort staalname]];"=D";Table128383941[BZV (mg/l)];">="&F11+(F11/100*30))

I need to find a way where if a measurement falls between dates it only uses those norms from the list between the corresponding dates, and have the year total. And I can not ask the client to add a new countif line each week.
The solutions may preferable be a formula or VBA if not possible.

Thanks in advance!
 

Attachments

  • Tab1.PNG
    Tab1.PNG
    132.2 KB · Views: 23
  • Tab2.png
    Tab2.png
    47.6 KB · Views: 27

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,224,876
Messages
6,181,520
Members
453,050
Latest member
Obil

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