Count the number of cells until a value is reached w/multiple criteria

Degausser124

New Member
Joined
Jun 14, 2022
Messages
5
Office Version
  1. 2021
Platform
  1. Windows
Hi!

First, big thanks to everyone who helps on this forum. I reference this board at least weekly and I'd be lost without you all.

Attached is a dumbed down version of my file. What I'm looking to do is:
  • Count the number of cells in the range D:K starting with Row 3 where the following 2 conditions are met:
    • Start counting in the during the starting week (Column B)
    • AND Stop counting when the headcount (Column A) is achieved
  • Column C is where the formula will live
Screenshot for MrExcel.png


Example:
  • Row 3: I want to know how many weeks it takes to meet or exceed 100 headcount (A3), starting with week 2 (B3)
    • Answer: Should be 5 because it starts with E3, counts that week and stops at I3

I'm pretty sure this is a combo of a COUNTIFS and Index Match but for some reason I just can't get it right.

Thanks so much!
 
OK, good...that's the version that returns the column index (week number) where headcount is met if it occurs before the "start" week...otherwise, the formula returns the number of weeks counted beginning with the start week up until the headcount is met.
 
Upvote 0

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

Forum statistics

Threads
1,215,759
Messages
6,126,731
Members
449,333
Latest member
Adiadidas

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